On 02/09/2012 11:36, Gilles wrote:
On Sun, 02 Sep 2012 12:19:02 +0200, Gilles <nos...@nospam.com> wrote:
(snip)

Found it:

#rewrite lines to new file
output = open('output.txt','w')

for line in textlines:
        #edit each line
        line = "just a test"
        output.write("%s" % line)

output.close()


IMHO better practice to use the with statement. See http://docs.python.org/reference/compound_stmts.html#the-with-statement

--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to