fin = open("data.txt") # in the working folder # open a specifically named file, data.txt, in some other folder fin = open("e:/python/data.txt") # PC fin = open("/Volumes/programming/python/data.txt") # Mac # open a file whose name is stored in a text variable fileName = "e:/python/data.txt" # PC fileName = "/Volumes/programming/python/data.txt" # Mac fin = open(fileName) # open a file whose name is entered by the user fileName = input("What file do you want to use for input? ") fin = open(fileName) # open a 2nd file (storing the filename in a text variable) fin.close() # close 1st file before opening 2nd fileName = input("What file do you want to use for input next? ") fin = open(fileName)