Ah, cool, I thought there might be a slicker way to do that but I was too lazy to look it up :) Thanks, Marshall
On Mar 3, 7:30 pm, Jason Grout <[email protected]> wrote: > 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' > > Seehttp://docs.python.org/library/stdtypes.html#string-formattingfor > 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
