Replace a whole line in a txt file

Posted by user302935 on Stack Overflow See other posts from Stack Overflow or by user302935
Published on 2010-03-26T23:27:20Z Indexed on 2010/03/26 23:33 UTC
Read the original article Hit count: 142

Filed under:
|
|
|

I'am new to Python 3 and could really use a little help. I have a txt file containing:

InstallPrompt=

DisplayLicense=

FinishMessage=

TargetName=D:\somewhere

FriendlyName=something

I have a python script that in the end, should change just two lines to:

TargetName=D:\new

FriendlyName=Big

Could anyone help me, please? I have tried to search for it, but I didnt find something I could use. The text that should be replaced could have different length.

© Stack Overflow or respective owner

Related posts about python-3.x

Related posts about python