#printfile.py
def main():
fname = raw_input("Enter filename: ")
infile = open(fname, 'r')
data = infile.read()
print data
main()
I have this file saved to the Desktop. If the user inputs file.txt during execution, where exactly does Python look to open that file?

New Topic/Question
Reply



MultiQuote





|