Re: Python newbie question re Strings and integers

2008-09-22 Thread Bruno Desthuilliers
rmac a écrit : Ah! Arghh!!! You are so correct on the usage of the ':' Python syntax is a little different from what I am used to. I don't know what you're used to, but chances are that more than the syntax differs !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python newbie question re Strings and integers

2008-09-20 Thread Bruno Desthuilliers
rmac a écrit : the following code attempts to extract a symbol name from a string: extensionStart = int(filename.rfind('.')) rfind returns an int, so passing it to the int type constructor is useless. filenameStart = int(filename.rfind('/')) idem #print 'Extension Start - ' +

Re: Python newbie question re Strings and integers

2008-09-18 Thread rmac
Ah! Arghh!!! You are so correct on the usage of the ':' Python syntax is a little different from what I am used to. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python newbie question re Strings and integers

2008-09-18 Thread Miki
>     currentSymbol=filename[int(filenameStart),int(extensionStart)] Should be currentSymbol=filename[int(filenameStart):int(extensionStart)] (change , to :) You don't need to convert to int all the time, rfind will return an integer. Also you can use os.path for this from os.path import

Re: Python newbie question re Strings and integers

2008-09-18 Thread Christian Heimes
rmac wrote: the following code attempts to extract a symbol name from a string: extensionStart = int(filename.rfind('.')) filenameStart = int(filename.rfind('/')) #print 'Extension Start - ' + str(extensionStart) #print 'FileName Start - ' + str(filenameStart) currentSymbol=f

Re: python newbie - question about lexical scoping

2007-12-02 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : (snip) > class Foo(object): > bar = {'baz':'bing'} > def __init__(self): > self.bar = self.bar Hem... Should re-read before posting :( It's of course: def __init__(self): self.bar = self.bar.copy() -- http://mail.python.org/mailman/listinfo/pyt

Re: python newbie - question about lexical scoping

2007-12-02 Thread hdante
On Dec 1, 11:31 pm, "Matt Barnicle" <[EMAIL PROTECTED]> wrote: > >> On Dec 1, 4:47 pm, Matt Barnicle <[EMAIL PROTECTED]> wrote: > > aye yaye aye... thanks for the pointers in the right direction.. i > > fiddled around with the code for a while and now i've reduced it to the > > *real* issue... i

Re: python newbie - question about lexical scoping

2007-12-02 Thread Bruno Desthuilliers
Matt Barnicle a écrit : >>>On Dec 1, 4:47 pm, Matt Barnicle <[EMAIL PROTECTED]> wrote: >> >>aye yaye aye... thanks for the pointers in the right direction.. i >>fiddled around with the code for a while and now i've reduced it to the >>*real* issue... i have a class dict variable that apparently

Re: python newbie - question about lexical scoping

2007-12-02 Thread Hrvoje Niksic
"Matt Barnicle" <[EMAIL PROTECTED]> writes: >> i have a class dict variable that apparently holds its value across >> instantiations of new objects.. [...] > ok, i see... python has a concept i'm not accustomed to I don't doubt that Python managed to confuse you here, but in this case there is n

Re: python newbie - question about lexical scoping

2007-12-01 Thread Matt Barnicle
>> On Dec 1, 4:47 pm, Matt Barnicle <[EMAIL PROTECTED]> wrote: > aye yaye aye... thanks for the pointers in the right direction.. i > fiddled around with the code for a while and now i've reduced it to the > *real* issue... i have a class dict variable that apparently holds its > value across in

Re: python newbie - question about lexical scoping

2007-12-01 Thread Matt Barnicle
>> On Dec 1, 4:47 pm, Matt Barnicle <[EMAIL PROTECTED]> wrote: > aye yaye aye... thanks for the pointers in the right direction.. i > fiddled around with the code for a while and now i've reduced it to the > *real* issue... i have a class dict variable that apparently holds its > value across in

Re: python newbie - question about lexical scoping

2007-12-01 Thread Tim Roberts
Matt Barnicle <[EMAIL PROTECTED]> wrote: >hi everyone.. i've been chugging along learning python for a few months >now and getting answers to all needed questions on my own, but this one >i can't figure out nor can i find information on the internet about it, >possibly because i don't understa

Re: python newbie - question about lexical scoping

2007-12-01 Thread Matt Barnicle
> On Dec 1, 4:47 pm, Matt Barnicle <[EMAIL PROTECTED]> wrote: >> hi everyone.. i've been chugging along learning python for a few months >> now and getting answers to all needed questions on my own, but this one >> i can't figure out nor can i find information on the internet about it, >> possibly

Re: python newbie - question about lexical scoping

2007-12-01 Thread Matt Barnicle
> On Dec 1, 4:47 pm, Matt Barnicle <[EMAIL PROTECTED]> wrote: >> hi everyone.. i've been chugging along learning python for a few months >> now and getting answers to all needed questions on my own, but this one >> i can't figure out nor can i find information on the internet about it, >> possibly

Re: python newbie - question about lexical scoping

2007-11-30 Thread John Machin
On Dec 1, 4:47 pm, Matt Barnicle <[EMAIL PROTECTED]> wrote: > hi everyone.. i've been chugging along learning python for a few months > now and getting answers to all needed questions on my own, but this one > i can't figure out nor can i find information on the internet about it, > possibly becau

Re: Python Newbie question

2006-10-13 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Is it possible to combine or bundle separate .exe files into the > compiled python .exe when using py2exe? If possible, how would that be > described within setup.py . and how/where would I specify such .exe > should be ran first in the pre-compiled scripts? My goal i

Re: python newbie question

2006-02-26 Thread Christoph Haas
On Sunday 26 February 2006 22:44, [EMAIL PROTECTED] wrote: > I am new to python, can you please tell me how can I convert my python > script into an executable on linux? > i.e. instead of typing 'python myscript.py abc', I just need to do > 'myscript.py abc'? Use the shebang syntax. Use this as a

Re: python newbie question

2006-02-26 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I am new to python, can you please tell me how can I convert my python > script into an executable on linux? > i.e. instead of typing 'python myscript.py abc', I just need to do > 'myscript.py abc'? > and how can I get the input argument from my script , in my example,