# create or overwrite a specifically named file, data.txt, in working folder fout = open("data.txt", "w") # create or overwrite a specifically named file, data.txt, in some other folder fout = open("e:/python/data.txt", "w") # create or overwrite a file whose name is stored in a variable as text fileName = "e:/python/data.txt" fout = open(fileName, "w") # create or overwrite a file whose name is entered by the user fileName = input("What file do you want to use for input? ") fout = open(fileName, "w") # create or overwrite a 2nd file (storing the filenames in variables) fout.close() # be sure to close 1st file before creating 2nd fileName = input("What file do you want to use for input next? ") fout = open(fileName, "w")