John Fouhy wrote: > On 15/09/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> This is the first time I have posted to this list so I hope I am asking >> appropriate question in acceptable way. Want I want to do is take a file and >> cut it into pieces so each piece is a new unique file; the new files would be >> one line (newline) from the file I want to cut up. The file I want to cut up >> has 3900 lines. This is as far as I have got. >> > > So, you want to create 3900 different files, then? > > What do you want to call these files? > > You can iterate through each line of a file like this: > > input = open('/Users/timothy/Desktop/t' , 'r') > for line in input: > # ... > Good example, except you shouldn't use 'input' since it's a builtin. :D Cheers. -Luke > So, in the body of the for loop, all you would need to do is decide > what to call the new file, open the file, write line to it, and then > close it. > >
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor