I am trying to use Tkinter to choose a file and then import that filename into an argument to pass in a function. The program simply stops after the file is chosen. I included a print statement just to see if it returns the path and it does so I am not sure why it won't work in the function.
#Main
from Tkinter import *
import tkFileDialog
fileOpen = Tk()
fileOpen.withdraw() #hiding tkinter window
file_path = tkFileDialog.askopenfilename(title="Open file", filetypes=[("txt file",".txt"),("All files",".*")])
if file_path != "":
print "you chose file with path:", file_path
else:
print "you didn't open anything!"
master.quit()
print file_path
spaceParser (file_path,'r','/Users/Desktop/TygerTygerParsed.txt','w')
masterisn't defined in your script, so when it gets tomaster.quit()it will raise:NameError: name 'master' is not defined.