edit text in a file and save it again

cyberco cyberco at gmail.com
Mon Nov 20 00:07:03 CET 2006

I must be overlooking something here... I'm trying to edit a line in a
text file. I thought this was easy with fileinput, but all examples do
not write the line back to the file but simply 'print' it. I want to
open the file, edit the line and save it again. Is fileinput the right
module for that?

More information about the Python-list mailing list