replace line #1 with "newline\n" in text file
jeremy_kauffman at hotmail.com
Wed Dec 24 14:57:26 CET 2003
"bmgz" <bmgz at dev.null> wrote in message news:<3fe955b8.0 at news1.mweb.co.za>...
> I am trying to replace the first line of a config file.. with a new string
> been googlizing and reading the python manual.. but can't find what I need..
> it's all rubbish about bits and bytes etc..
lines = open('config.txt', 'r').readlines()
lines = 'newline\n'
More information about the Python-list