Re: [Tutor] Creating new files w/o overwriting existing ones

2007-04-09 Thread Kent Johnson
Alan Gauld wrote: > "Dick Moores" <[EMAIL PROTECTED]> wrote > >> lstNums = [] >> for x in lstSvg: >> num = int(x.split('.')[0]) >> lstNums.append(num) > > This is exactly what a list comp does so you could rewrite it as: > > lstNums = [int(x.split('.')[0]) for x in lstSv

Re: [Tutor] Creating new files w/o overwriting existing ones

2007-04-09 Thread Dick Moores
At 08:19 AM 4/9/2007, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > lstNums = [] > > for x in lstSvg: > > num = int(x.split('.')[0]) > > lstNums.append(num) > >This is exactly what a list comp does so you could rewrite it as: > >lstNums = [int(x.split('.')

Re: [Tutor] Creating new files w/o overwriting existing ones

2007-04-09 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote > lstNums = [] > for x in lstSvg: > num = int(x.split('.')[0]) > lstNums.append(num) This is exactly what a list comp does so you could rewrite it as: lstNums = [int(x.split('.')[0]) for x in lstSvg] One of the cases where I actua

Re: [Tutor] Creating new files w/o overwriting existing ones

2007-04-09 Thread Dick Moores
At 03:39 AM 4/9/2007, Kent Johnson wrote: >Dick Moores wrote: >>Sorry if my Subject line isn't clear about what my question is. >>I have a script that uses the turtle and random modules to create >>SVG files, one after another, in a directory just for the SVGs. The >>script assigns filenames in t

Re: [Tutor] Creating new files w/o overwriting existing ones

2007-04-09 Thread Kent Johnson
Dick Moores wrote: > Sorry if my Subject line isn't clear about what my question is. > > I have a script that uses the turtle and random modules to create SVG > files, one after another, in a directory just for the SVGs. The > script assigns filenames in the form, "n.svg", where n is an integer.

[Tutor] Creating new files w/o overwriting existing ones

2007-04-09 Thread Dick Moores
Sorry if my Subject line isn't clear about what my question is. I have a script that uses the turtle and random modules to create SVG files, one after another, in a directory just for the SVGs. The script assigns filenames in the form, "n.svg", where n is an integer. E.g. 1.svg, 2.svg. 3.svg, .