import sys # Author: James Tam # Version: June 8, 2017 # Replaced sys.stdout.write() with print() # Version: November 17, 2011 # A program by James Tam that reads in letter grades from a file # and displays the grades onscreen. # Get information about the file name at run time from the user. # Try it with "gpa.txt" or "letters.txt" as the input file. inputFileName = input ("Enter name of input file: ") inputFile = open (inputFileName, "r") print("Opening file", inputFileName, " for reading.") # While we haven't read past the end of the file continue reading from it. for line in inputFile: print(line, end="") inputFile.close() print("Completed reading of file", inputFileName)