I am trying to read a filename that has a period in it, into this simple program.. files like "test" work, while test.txt fail. I kinda see why. when I type in "test.txt", only "test" appears. when I use quotes, I get:
IOError: [Errno 2] No such file or directory: "'test.txt'"
is there a simple way I can read file names that have things like extensions?
#!/usr/bin/python
#File Attributes
fn=input("Enter file Name: ")
print (fn) #added so i know why its failing.
f = open(`fn`,'r')
lines = f.read()
print(lines)
f.close()