wes3449
wes3449

Reputation: 305

Python 3.3 tkinter.filedialog.askopenfile() leaves an unresponsive Tk window

I'm trying to have the user select a file through a pop-up directory browser. Looking things up suggested that I use filedialog.askopenfile(), which works but leaves a small unresponsive tk window that I'd rather not have because any attempt to interact with it causes the kernel to crash and need to be restarted.

Does anyone have any solutions or alternatives? Thanks.

Upvotes: 3

Views: 2286

Answers (1)

NDevox
NDevox

Reputation: 4086

This works fine:

from tkinter import *

root = Tk()
root.withdraw()

filedialog.askopenfile()

Upvotes: 1

Related Questions