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
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 - ' +
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
> 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
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
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=filename[int(f