I am trying since the last 3 days make a script where user can puts his file and the script edit the text for put in lowercase all the words. I think that code is correct, I tried other forms for program this script but is not working me (including this code).
The problem is that when you run the python script and you put the file that you want to edit never edits the text that is infile the document. (if someone is asking self where is the file .txt, is in the same folder like the script.)
Here the code:
fname = input("Enter file name: ")
with open(fname, 'r') as f:
for line in f:
l=line.title()
print(l)
Is really simple but is not working... And I don´t know why. Also I tried to put the absolute rute but is not working... :/
Thanks in advance!