Open File Dialog freezes after tkinter askopenfilename method is called
Question: I'm trying to simply get a file name from the user by
`tkinter.filedialog.askopenfilename()`. The function returns fine and the code
below displays the file name okay but the dialog window doesn't close
immediately after hitting 'open' or 'cancel', it freezes. I'm using python
3.3.3 or OSX 10.9.1 and tcl/tK 8.5.9.

    
    
    from tkinter import *
    from tkinter.messagebox import *
    from tkinter.filedialog import *
    
    top = Tk()
    top.withdraw()
    
    file_name = filedialog.askopenfilename()
    
    print (file_name)
    


Answer: You don't need to specify module name in

    
    
    file_name = filedialog.askopenfilename()
    

Try

    
    
    file_name = askopenfilename()
    

instead

