So far, I have:
from string import *
def reverse():
fname = raw_input("Ente r a Filename: ")
infile = open(fname, 'r')
data = infile.read()
list(data)
print fname[-1:1]
I need python to read the file (whichever the user wants to open), but print it in reverse and save it. I know I need to treat the file as a string, but I am obviously not doing something right.. Any help would be great.
from string import *
def reverse():
fname = raw_input("Ente r a Filename: ")
infile = open(fname, 'r')
data = infile.read()
list(data)
print fname[-1:1]
I need python to read the file (whichever the user wants to open), but print it in reverse and save it. I know I need to treat the file as a string, but I am obviously not doing something right.. Any help would be great.
Comment