Reputation: 305
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
Reputation: 4086
This works fine:
from tkinter import *
root = Tk()
root.withdraw()
filedialog.askopenfile()
Upvotes: 1