I'm just trying to create a program that will remove all the trailing whitespace in a text file.
(Like all the whitespace after each sentence for the whole text file.)
n = raw_input("Enter name of file: ")
f = file(n, "r")
fr = f.read()
for fr in f:
fr = fr.rstrip()
f.close()
print fr
The problem I have is after I did the rstrip(), nothing really happened to the text file? I don't really know what I'm missing.