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.
>>> output = open('/Users/timothy/Desktop/d' , 'w')
>>> input = open('/Users/timothy/Desktop/t' , 'r')
>>> l = input.readlines()
>>> output.writelines(l)
>>> output.close()
What I did was copy file r to file d. What I think I need is a for or while
expression that as each readlines is occuring it will be output as one seperate
file. Also I think I need to import sys.stdout and somehow have the readlines be
piped through that or maybe sys.argv used in some way, but these are rather
vague intuitions---can't think how to put this together.
Is what I want to do stated clearly and is this the sort of questions to ask
here?
Thank-you, Timothy

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to