On 03/03/2010 06:25 PM, Marshall Hampton wrote:
Okay, this is somewhat baroque but might be helpful.  One of the main
things is the zero-padding of file names, e.g. in the line "fname =
prelabel + '0'*(3-len(str(i)))+str(i)":


You could use the python formatting magic:

sage: "%03d"%1
'001'
sage: "%03d"%11
'011'
sage: "%03d"%199
'199'
sage: "%03d"%1999
'1999'

See http://docs.python.org/library/stdtypes.html#string-formatting for more options.


Thanks,

Jason

--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to