hi,
> Oh I see. You have to combine a couple of concepts but for this
> example you'd say:
>
>name = 'james' # 'l' looks too much like the digit 1
>for i,c in enumerate(name):
> print i, c
>print i
>
> enumerate(name) generates the sequence
>
>(0,'j'), (1,'a'), (2,'m'),
Gabriel Genellina wrote:
> On 21 ago, 18:36, [EMAIL PROTECTED] (John J. Lee) wrote:
>> Gabriel Genellina <[EMAIL PROTECTED]> writes:
>>
>> [...]> Don't even try to understand it - it's a mess. Use the HTMLParser
>>> module instead.
>> [...]
>>
>> Module sgmllib (and therefore module htmllib also) i
Hello,
e.g I need run my my_scripts_setup.bat that contain:
python myscript_setup.py py2exe
Can I cover or redirect log of that process into my wx program?
I'am using Windows XP SP2, and Python 2.5.
Regards,
Vedran
--
http://mail.python.org/mailman/listinfo/python-list
james_027 <[EMAIL PROTECTED]> writes:
> Yes i am new to python :). I am sorry I should be clarify myself ...
> for example
>
> l = ['j', 'a', 'm', 'e', 's']
>
> for i in l
> # i want to know the nth number of times it has loop thru or
> something like counter?
Oh I see. You have to combine a c
On 8/22/07, james_027 <[EMAIL PROTECTED]> wrote:
> hi Paul,
>
> >
> > That doesn't crash or anything like that, but it also doesn't
> > set the index variable, which can cause confusion in some situations.
>
> Thanks for your quick answer ... Actually I was thinking how do I
> access the index insi
hi,
> It sounds like you're just starting to learn the language... have you
> read the online tutorial yet? That is a pretty easy introduction.
>
> See:http://python.org/doc/
>
> Anyway, you can say
>
>for i in (1,2,3):
> print i*5
>
> to print 5, 10, and 15 on separate lines, for examp
james_027 <[EMAIL PROTECTED]> writes:
> Thanks for your quick answer ... Actually I was thinking how do I
> access the index inside a for statement? Can you help
It sounds like you're just starting to learn the language... have you
read the online tutorial yet? That is a pretty easy introduction.
hi Paul,
>
> That doesn't crash or anything like that, but it also doesn't
> set the index variable, which can cause confusion in some situations.
Thanks for your quick answer ... Actually I was thinking how do I
access the index inside a for statement? Can you help
Thanks
james
--
http://mai
james_027 <[EMAIL PROTECTED]> writes:
> for i in []:
> #do something
> is this safe? or should I put a if statement to test it first?
That doesn't crash or anything like that, but it also doesn't
set the index variable, which can cause confusion in some situations.
--
http://mail.python.org/mail
On Tue, 21 Aug 2007 21:23:25 -0300, Ricardo Aráoz wrote:
> Do you know if for in-house development a GPL license applies? (Qt4
> and/or Eric4).
(I'm not sure if I've understood your question right)
If you distribute an app that _uses_ PyQT, you have to comply with the GPL
(or buy a license
hi,
I need to do some for loop on iterables which could be empty
sometimes, for example
a_list = []
for i in a_list:
#do something
is this safe? or should I put a if statement to test it first?
Thanks
james
--
http://mail.python.org/mailman/listinfo/python-list
Oh my God! How did you know?!! You were so smart to post that here!
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> http://freeairconditioners.blogspot.com/
>
--
http://mail.python.org/mailman/listinfo/python-list
Steve Mavronis schrieb:
> I tried to install Python 2.51 on Microsoft Vista Ultimate 32-bit
> because I use the 3D modeler software Blender 2.44, in case I needed
> additional Python support in the future for add-on scripts.
>
> I got a warning about "files in use" during installation that needed
On Aug 17, 4:25 am, Paul McGuire <[EMAIL PROTECTED]> wrote:
> In responding to another post on defaultdict, I posted an
> implementation of a 2-level hashtable, by creating a factory method
> that returned a defaultdict(dict). The OP of that other thread was
> trying to build a nested tree from a
Grant Edwards wrote:
> On 2007-08-21, avishay <[EMAIL PROTECTED]> wrote:
>
>> I'm trying to chain two programs with a pipe (the output of
>> one feeding the input of the other). I managed to capture the
>> output and feeding the input of each program independently
>> with popen, but how do I tie t
Ricardo Aráoz wrote:
> Hi,
> Do you know if for in-house development a GPL license applies? (Qt4
> and/or Eric4).
If your programs are used in-house and never released, then you don't
have to abide by the terms of the GPL. BUT (this is a big but) if you
ever release your code or distribute
Hrvoje Niksic wrote:
> Nick Craig-Wood <[EMAIL PROTECTED]> writes:
>
>> If you are running linux > 2.6.18 then you can use
>> /proc/sys/vm/drop_caches for exactly that purpose.
>>
>> http://www.linuxinsight.com/proc_sys_vm_drop_caches.html
>
> That URL claims that you need to run "sync" before
Hi,
I have a doubt. Supose that i have the minimun class below:
class db:
def __init__(self):
self.db = {}
def read(self, key):
return self.db[key]
def write(self, key, value):
self.db[key] = value
and an object of this class is shared among some threads. Is
Nick Craig-Wood <[EMAIL PROTECTED]> writes:
> If you are running linux > 2.6.18 then you can use
> /proc/sys/vm/drop_caches for exactly that purpose.
>
> http://www.linuxinsight.com/proc_sys_vm_drop_caches.html
That URL claims that you need to run "sync" before dropping the cache,
and so do oth
On Aug 21, 6:40 pm, [EMAIL PROTECTED] (Cameron Laird) wrote:
> In article <[EMAIL PROTECTED]>,Nagarajan <[EMAIL PROTECTED]> wrote:
> >Hi group,
> >I need to develop a web application. I am in a fix as to choose among
> >the various server-side scripting options. I want to explore python
> >(am a n
On Aug 21, 8:33 pm, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2007-08-22, Karthik Gurusamy <[EMAIL PROTECTED]> wrote:
>
> > Not sure on non-unix platforms, but in unix like platforms it's best
> > to reuse shell's power.
>
> import commands
> commands.getoutput('ls | wc')
> > ' 4
On 2007-08-22, Karthik Gurusamy <[EMAIL PROTECTED]> wrote:
> Not sure on non-unix platforms, but in unix like platforms it's best
> to reuse shell's power.
>
import commands
commands.getoutput('ls | wc')
> ' 4 4 24'
Executing a shell just because you want a pipe see
On 2007-08-21, avishay <[EMAIL PROTECTED]> wrote:
> I'm trying to chain two programs with a pipe (the output of
> one feeding the input of the other). I managed to capture the
> output and feeding the input of each program independently
> with popen, but how do I tie them together?
On Unix, you d
On 21 ago, 18:36, [EMAIL PROTECTED] (John J. Lee) wrote:
> Gabriel Genellina <[EMAIL PROTECTED]> writes:
>
> [...]> Don't even try to understand it - it's a mess. Use the HTMLParser
> > module instead.
>
> [...]
>
> Module sgmllib (and therefore module htmllib also) is more tolerant of
> bad HTML t
On 21 ago, 21:40, Karthik Gurusamy <[EMAIL PROTECTED]> wrote:
> On Aug 21, 3:09 pm, avishay <[EMAIL PROTECTED]> wrote:
>
> > I'm trying to chain two programs with a pipe (the output of one
> > feeding the input of the other). I managed to capture the output and
> > feeding the input of each program
Greg Copeland wrote:
> I'm having a brain cramp right now. I can't see to recall the name of
Is your cramp gone now ? :P
--
http://mail.python.org/mailman/listinfo/python-list
On 21 ago, 20:10, Steve Holden <[EMAIL PROTECTED]> wrote:
> Gabriel Genellina wrote:
>
> [...]working crystall balls are hard to find nowadays :)
>
> Well, judging by the OP's response you appear to be in possession of a
> pair :-)
Great-grandmother's legacy, and not for sale!
--
Gabriel Genellin
David,
If your true design intent is to run X number of test cases, unittest
is the biggest bang for your buck, like shown by Peter's example. You
just subclass unittest.TestCase, and def your test methods in the
class body; they will simply be executed in the order you list them.
It's just nice h
On 8/21/07, codesite-noreply <[EMAIL PROTECTED]> wrote:
> On 22 Ago, 02:09, "Evan Klitzke" <[EMAIL PROTECTED]> wrote:
> > On 8/21/07, billiejoex <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Hi there,
> > > I'm facing a case where I need to get the traceback outptut when
> > > occurring an exception
I'm having a brain cramp right now. I can't see to recall the name of
a module. I know there is a python module which allows for optimized
socket writes on Linux. It uses a syscall to obtain its benefit.
IIRC, it is a fast path for I/O bound servers.
Can someone please refresh my memory? What
On 22 Ago, 02:09, "Evan Klitzke" <[EMAIL PROTECTED]> wrote:
> On 8/21/07, billiejoex <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi there,
> > I'm facing a case where I need to get the traceback outptut when
> > occurring an exception.
> > I solved such problem by using traceback module in conjunction wit
I tried to install Python 2.51 on Microsoft Vista Ultimate 32-bit because I
use the 3D modeler software Blender 2.44, in case I needed additional Python
support in the future for add-on scripts.
I got a warning about "files in use" during installation that needed
updating. I aborted the install
king kikapu wrote:
> On Aug 21, 12:00 pm, Joel Andres Granados <[EMAIL PROTECTED]>
> wrote:
>> Hello list:
>>
>> I have tried various times to use an IDE for python put have always been
>> disapointed.
>
>
> I have also tried a lot of them (IDEs) in the last year. I was finally
> happy with Eclip
Any reason why this wouldn't work?
>>> from collections import defaultdict
>>> def rdict(*args, **kw):
... return defaultdict(rdict, *args, **kw)
...
>>> d = rdict()
>>> d[1][2][3][4][5] # ...
defaultdict(, {})
~ Daniel
--
http://mail.python.org/mailman/listinfo/python-list
On 21 Ago, 22:36, Brad Johnson <[EMAIL PROTECTED]> wrote:
> Joel Andres Granados gmail.com> writes:
>
>
>
> > Hello list:
>
> > I have tried various times to use an IDE for python put have always been
> > disapointed.
>
> Not sure which platform you're on, but I've really liked PyScripter for the
On Aug 21, 3:09 pm, avishay <[EMAIL PROTECTED]> wrote:
> Hello
> I'm trying to chain two programs with a pipe (the output of one
> feeding the input of the other). I managed to capture the output and
> feeding the input of each program independently with popen, but how do
> I tie them together? Is
Is it possible to cause this sort of thing to happen on Windows.
Specifically, I'm looking for a way to cause multiple processes to
accept new connections on a bound socket. on UNIX, I can just fork()
after binding the server socket to a port and the children can
accept() on that same socket, but
king kikapu wrote:
> On Aug 21, 12:00 pm, Joel Andres Granados <[EMAIL PROTECTED]>
> wrote:
>> Hello list:
>>
>> I have tried various times to use an IDE for python put have always been
>> disapointed.
>
>
> I have also tried a lot of them (IDEs) in the last year. I was finally
> happy with Eclip
On 8/21/07, billiejoex <[EMAIL PROTECTED]> wrote:
> Hi there,
> I'm facing a case where I need to get the traceback outptut when
> occurring an exception.
> I solved such problem by using traceback module in conjunction with
> StringIO:
>
> import StringIO, traceback
> try:
> raise Exception
>
Hi there,
I'm facing a case where I need to get the traceback outptut when
occurring an exception.
I solved such problem by using traceback module in conjunction with
StringIO:
import StringIO, traceback
try:
raise Exception
except:
f = StringIO.StringIO()
traceback.print_exc(file=f)
[EMAIL PROTECTED] wrote:
> Hi, just wanted to invite any Python script authors to submit their
> Python script to our popular software site
> at [http:elided]
>
> We have just today added a "Scripts" directory which includes a Python
> subdirectory
> [http:elided]
>
> The first submissions usuall
http://freeairconditioners.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
[...]working crystall balls are hard to find nowadays :)
Well, judging by the OP's response you appear to be in possession of a
pair :-)
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype
Hyuga wrote:
> On Aug 19, 4:29 pm, mosscliffe <[EMAIL PROTECTED]> wrote:
>> The source file is in an area which python can see, but not the
>> browser. I am trying to make a link in a browser friendly area so I
>> can use it to display an image file.
>
> You might want to try using an .htaccess f
Thanks for the suggestion. I've tried logging in and sending email
manually and it works just fine.
Thanks though,
James
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
>From your description I think something like PyParsing might be useful to you.
http://pyparsing.wikispaces.com/
If not then I guess I m not understanding your question right.
Hope this helps
Nathan
On 21/08/07, Robert Dailey <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am looking for a sort of
Is there a debugging mode in emacs that works well with python?
I tried gud, but it was giving me errors, so I thought I'd ask before I
try to get it to work: Is there an emacs mode (perhaps gud) that'll give a
view of the python source, and currenly executing line, the ability
inspect datastruct
Maybe my question wasn't very clear. What I meant is that these four
lines lead in my case to two entries per logged event:
applog = logging.getLogger()
applog.setLevel(logging.DEBUG)
hdl = logging.FileHandler('/tmp/foo.log')
applog.addHandler(hdl)
However if I REPLACE the above by:
logging.basi
On Aug 21, 1:53 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> Silfheed wrote:
> > On Aug 21, 1:32 am, James Stroud <[EMAIL PROTECTED]> wrote:
> >> Silfheed wrote:
> >> > Heyas
>
> >> > So this probably highlights my lack of understanding of how naming
> >> > works in python, but I'm currently using
How about embedding ipython in your script with:
from IPython.Shell import IPShellEmbed
ipshell = IPShellEmbed()
** your set up code **
ipshell() # this call anywhere in your program will start IPython
see: http://ipython.scipy.org/doc/manual/node9.html#sec:embed
Here are some ipython tips: h
Hello
I'm trying to chain two programs with a pipe (the output of one
feeding the input of the other). I managed to capture the output and
feeding the input of each program independently with popen, but how do
I tie them together? Is there a solution that works equally on all
platforms?
Thanks,
Av
On 21 Ago, 23:07, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hey all,
>
> I've been using libgmail to send out automated notification emails for
> my company's nightly regression testing. Last night these emails
> started failing, though the python code has not changed. I updated to
> the l
Shiao wrote:
>> You need to remove the handler from the logging object
>>
>> # remove the handler once you are done
>> applog.removeHandler(hdl)
> I'm not sure how this could help.
If you have multiple handlers you'll get a logged message for every handler.
In your code logging.basicConfig() im
Gabriel Genellina <[EMAIL PROTECTED]> writes:
[...]
> Don't even try to understand it - it's a mess. Use the HTMLParser
> module instead.
[...]
Module sgmllib (and therefore module htmllib also) is more tolerant of
bad HTML than module HTMLParser.
John
--
http://mail.python.org/mailman/listinfo
On Aug 21, 5:11 pm, John McGaw <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Reviews of latest models of best guitars, fender, gibson, yamaha, and
> > many more, with pictures and prices.
>
> Are these new guitars made of SPAM like your message and your "blog"?
That'd be bloody terribl
>
> You need to remove the handler from the logging object
>
> # remove the handler once you are done
> applog.removeHandler(hdl)
>
> Cheers,
> amit.
>
I'm not sure how this could help.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Reviews of latest models of best guitars, fender, gibson, yamaha, and
> many more, with pictures and prices.
Are these new guitars made of SPAM like your message and your "blog"?
--
http://mail.python.org/mailman/listinfo/python-list
Hey all,
I've been using libgmail to send out automated notification emails for
my company's nightly regression testing. Last night these emails
started failing, though the python code has not changed. I updated to
the latest libgmail, but that isn't helping. I've logged in to the
email account
On Aug 20, 1:53 am, math2life <[EMAIL PROTECTED]> wrote:
> I work with python for two years, are familiar with image processing,
> but beginner on PyOpenGL and OpenGL.
>
> Any advice appreciated!
Here's a little "hello world" PyOpenGL program I had lying around that
might be useful:
http://www.mi
lol...
On 8/21/07, Tony <[EMAIL PROTECTED]> wrote:
>
> I don't who is posting here stupid shit about guitars
> who ever is do self fever hang your self with one of strings
>
>
> "kaldrenon" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > On Aug 20, 8:54 pm, Twisted <[EMAIL PROTEC
Hi,
I am looking for a sort of "tokenizer" for python. I've taken a look at the
tokenize module, but that seems to parse python code from what I read. I
want a tokenizer that works a little like boost::tokenizer, however for
python. Basically I want to be able to pass in an arbitrary string (or li
On Tue, 21 Aug 2007 21:56:18 +0200, Hrvoje Niksic <[EMAIL PROTECTED]>
wrote:
>Christof Winter <[EMAIL PROTECTED]> writes:
>
>> To get rid of the if statements, replace __init__ function with:
>>
>> def __init__(self, tc):
>> functionToCall = eval("self.testCase%s" % tc)
>
>Or functio
Silfheed wrote:
> On Aug 21, 1:32 am, James Stroud <[EMAIL PROTECTED]> wrote:
>> Silfheed wrote:
>> > Heyas
>>
>> > So this probably highlights my lack of understanding of how naming
>> > works in python, but I'm currently using FailUnlessRaises in a unit
>> > test and raising exceptions with a st
Joel Andres Granados gmail.com> writes:
>
> Hello list:
>
> I have tried various times to use an IDE for python put have always been
> disapointed.
Not sure which platform you're on, but I've really liked PyScripter for the
Windows platform.
--
http://mail.python.org/mailman/listinfo/python
Thanks to all for the valuable suggestions.
On 8/21/07, Benjamin <[EMAIL PROTECTED]> wrote:
>
> On Aug 21, 5:00 am, Joel Andres Granados <[EMAIL PROTECTED]>
> wrote:
> > Hello list:
> >
> > I have tried various times to use an IDE for python put have always been
> > disapointed.
> > I haven't rev
Christof Winter <[EMAIL PROTECTED]> writes:
> To get rid of the if statements, replace __init__ function with:
>
> def __init__(self, tc):
> functionToCall = eval("self.testCase%s" % tc)
Or functionToCall = getattr(self, "testCase" + tc)
eval can introduce unwanted side effects.
--
franko353 wrote:
> I have wxPython programs that work fine in Win2000/XP using os.exec().
>
> They do not work in MS Vista. Has anyone else had any luck with
> exec()?
>
> I keep getting an 'invalid option' error.
>
> It turn out it was really a security issue and I had to move to a
> "win32proc
On Aug 20, 11:12 am, "Robert Dailey" <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> Sorry for taking so long to respond. I had actually figured out what
> this issue is over on the wxPython mailing list. The issue was that I
> was attempting to configure wxPython controls from a remote thread,
> which
[EMAIL PROTECTED] schrieb:
> Hello,
>
> I'm looking for an image manipulation library which would allow me to
> blur an oval-shaped part of my picture, instead of the whole thing. I
> couldn't find a way to do this using the
> tools I see in the API of Python Imaging Library.
Create a copy of the
On Aug 20, 7:31 am, "Mark Dufour" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have just released Shed Skin 0.0.23. It doesn't contain the type
> inference scalability improvements I was working on, but it does have
> quite a few bug fixes and minor feature additions. Here's a list of
> changes:
>
>
On Aug 20, 7:31 am, "Mark Dufour" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have just released Shed Skin 0.0.23. It doesn't contain the type
> inference scalability improvements I was working on, but it does have
> quite a few bug fixes and minor feature additions. Here's a list of
> changes:
>
>
On 8/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On 21 Aug, 17:42, Gary Herron <[EMAIL PROTECTED]> wrote:
> > [EMAIL PROTECTED] wrote:
> > > Hi,
> >
> > > Do the Python Paths come in the form of a dictionary where I can
> > > access a particular path my its key in the registry?
> >
> > >
I have wxPython programs that work fine in Win2000/XP using os.exec().
They do not work in MS Vista. Has anyone else had any luck with
exec()?
I keep getting an 'invalid option' error.
It turn out it was really a security issue and I had to move to a
"win32process.CreateProcess" solution to fix
This may be common information, but I had trouble finding it.
I was getting an ImportError whenever I tried to run a built app from
py2app.
It turns out that using py2app version "0.3.6", it was having trouble
with zipped egg installs.
I had to move my zipped egg file to a temporary location (fr
Hello,
I'm looking for an image manipulation library which would allow me to
blur an oval-shaped part of my picture, instead of the whole thing. I
couldn't find a way to do this using the
tools I see in the API of Python Imaging Library.
If you know how to do this, I'd appreciate it if you left a
On Aug 21, 1:32 am, James Stroud <[EMAIL PROTECTED]> wrote:
> Silfheed wrote:
> > Heyas
>
> > So this probably highlights my lack of understanding of how naming
> > works in python, but I'm currently using FailUnlessRaises in a unit
> > test and raising exceptions with a string exception. It's wor
On 21 Aug, 17:42, Gary Herron <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Hi,
>
> > Do the Python Paths come in the form of a dictionary where I can
> > access a particular path my its key in the registry?
>
> > For example, in PythonWin Tools>>Edit Python Paths shows the name as
> >
David N Montgomery wrote:
> class testCase:
> def __init__(self, tc):
> if tc == 1:self.testCase1()
> if tc == 2:self.testCase2()
> if tc == 3:self.testCase3()
> if tc == 4:self.testCase4()
> if tc == 5:self.testCase5()
> if tc == 6:self.testCase6
I don't who is posting here stupid shit about guitars
who ever is do self fever hang your self with one of strings
"kaldrenon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Aug 20, 8:54 pm, Twisted <[EMAIL PROTECTED]> wrote:
>> If the message then
>> says something absurd, lik
Ha! I knew it was obvious. Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 21, 7:24 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> On 8/21/07, Ant <[EMAIL PROTECTED]> wrote:
>
> > On Aug 21, 11:01 am, subeen <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > ...
> > > But I want to write the GUI and number generation program in C#.net.
> > > When the user clicks Quick Sort
Wolfgang Draxinger <[EMAIL PROTECTED]> wrote:
> Marc 'BlackJack' Rintsch wrote:
>
> > You mean reading the file without actually reading it!? :-)
>
> Linux provides its specific syscall 'readahead' that does exactly
> this.
It isn't in the posix module, but you can use it with ctypes like th
On Aug 21, 2:57 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
[...]
>
> pay = min(num, 22) * 0.4 + max(num-22, 0) * 1.4
pay = num*0.4 + (num>22)*(num-22)
;-)
-=Dave
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> I'm confused about why i get a type error when i call an object's
> method. Here's the example code:
>
class Foo:
>
> def __init__(self):
> self.foo = []
> def foo(self):
> print "in foo!"
>
>
>
f = Foo()
dir(f)
>
On Aug 21, 11:07 am, [EMAIL PROTECTED] wrote:
> I'm confused about why i get a type error when i call an object's
> method. Here's the example code:>>> class Foo:
>
> def __init__(self):
> self.foo = []
> def foo(self):
> print "in foo!"
>
> >>> f =
I'm confused about why i get a type error when i call an object's
method. Here's the example code:
>>> class Foo:
def __init__(self):
self.foo = []
def foo(self):
print "in foo!"
>>> f = Foo()
>>> dir(f)
['__doc__', '__init__', '__module__', 'foo']
Lamonte Harris wrote:
> What is the main reason of "self" when it involves classes/functions
>
"self" provides a semi-standard way of addressing the current instance
of a class. It is used in an instance's method. It is not typically
used in functions.
Colin W.
--
http://mail.python.org/mail
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Robert Dailey schrieb:
> Thank you for your response. The back slashes work! It's a bit annoying; but
> I have Microsoft to thank for that.
It's not Microsoft, you would experience the same problems under any
Unix I know of. At least the bash treats q
Hi, just wanted to invite any Python script authors to submit their
Python script to our popular software site
at http://www.myzips.com
We have just today added a "Scripts" directory which includes a Python
subdirectory
http://www.myzips.com/category/Scripts/
The first submissions usually maintai
On 8/21/07, Looney, James B <[EMAIL PROTECTED]> wrote:
>
>
>
> How do I get access to a data buffer in Python so that I can directly
> view/modify the data? My buffer size is 256 (for this specific case) bytes.
> Most of the time, I access want to access that data in 4-byte chunks,
> sometimes in
Floris Bruynooghe wrote:
> When in a new-style class you can easily transform attributes into
> descriptors using the property() builtin. However there seems to be
> no way to achieve something similar on the module level, i.e. if
> there's a "version" attribute on the module, the only way to chan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
David N Montgomery schrieb:
> class testCase:
> def __init__(self, tc):
> if tc == 1:self.testCase1()
> if tc == 2:self.testCase2()
> if tc == 3:self.testCase3()
> if tc == 4:self.testCase4()
> if tc == 5:sel
On 8/21/07, rodrigo <[EMAIL PROTECTED]> wrote:
> How would I go about retrieving a variable's name (not its value)?
http://effbot.org/pyfaq/how-can-my-code-discover-the-name-of-an-object.htm
--
Cheers,
Simon B.
[EMAIL PROTECTED]
http://www.brunningonline.net/simon/blog/
GTalk: simon.brunning | M
On Aug 21, 11:52 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I tryed your code and got an error message #I use Wing IDE:
> Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)]
> Type "help", "copyright", "credits" or "license" for more information.
>
> Evaluating lines 1-16 from
On Aug 20, 8:18 pm, Asun Friere <[EMAIL PROTECTED]> wrote:
> On Aug 21, 4:34 am, [EMAIL PROTECTED] wrote:
>
> > to concatenate 2 lists to each other before it does the join, ... is
> > impossible in Python. The "+" operator is only for addition and for
> > two or more strings.
>
> Really?
>
> >>> [
rodrigo wrote:
> How would I go about retrieving a variable's name (not its value)? I
> want to write a function that, given a list of variables, returns a
> string with each variable's name and its value, like:
>
> a: 100
> b: 200
>
> I get the feeling this is trivial, but I have been unable to
[EMAIL PROTECTED] wrote:
> On Aug 20, 1:16 pm, "Robert Dailey" <[EMAIL PROTECTED]> wrote:
[...]
> When you use join, you join the items in the list with each other to
> form one long string. In your statement, your script tries to
> concatenate 2 lists to each other before it does the join, which i
On Aug 21, 4:38 am, Ant <[EMAIL PROTECTED]> wrote:
> On Aug 20, 11:47 pm, [EMAIL PROTECTED] wrote:
> ...
>
> > Thanks for the help. By the way I am trying to learn the python after
> > work and on weekends. If it was a dumb question, to this group, I will
> > not bother you all again.
>
> It's not
On Aug 18, 2:22 pm, "Aaron" <[EMAIL PROTECTED]>
wrote:
> Hello all.
>
> I realize that proposals dealing with alternatives to indentation have been
> brought up (and shot down) before, but I would like to take another stab at
> it, because it is rather important to me.
>
> I am totally blind, and
On Aug 21, 11:20 am, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote:
> I suspect lambda might be your friend here too for making the code less
> verbose, though I never really got the hang of lambdas, even though my
> first programming experience was a scheme class way back when Ah well.
That's be
1 - 100 of 186 matches
Mail list logo