0

I want to replace particular word in file with other one using python. anyone please help me

Here is my code. i don't know what wrong in it. https://code.sololearn.com/cm362lrChRf8/?ref=app

27th Aug 2017, 3:25 PM
Rayudu Sai Lokesh
Rayudu Sai Lokesh - avatar
2 Respuestas
0
file1 = open("textfile") file1 = file1.replace("before", "after")
27th Aug 2017, 3:35 PM
clement
clement - avatar
0
Thanks for your reply i want to open a text file and replace particular word with new word and close the file.
27th Aug 2017, 3:38 PM
Rayudu Sai Lokesh
Rayudu Sai Lokesh - avatar