-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't work with tkinter.filedialog.askdirectory #580
Comments
Given that you are using Python 3.9, I assume you are using the WinRT backend. This could be caused by microsoft/xlang#690 since both Bleak and Tkinter need to initialize the thread to use Windows APIs. |
Does this work? import bleak
import tkinter as tk
from tkinter import filedialog
from winrt import _winrt
_winrt.uninit_apartment()
root = tk.Tk()
dest_path = filedialog.askdirectory() |
Yes! It works. Thanks you very much! import bleak
import tkinter as tk
from tkinter import filedialog
from winrt import _winrt
_winrt.uninit_apartment() # This line make filedialog.askdirectory() work
root = tk.Tk()
dest_path = filedialog.askdirectory() But I still confuse, without filedialog.asksaveasfile() What make If you have any idea, I would like to try. |
|
This shed a lot of light on problems using GUIs with Bleak. This should be addressed in #266. Good work finding |
Description
when using import bleak and tkinter.filedialog.askdirectory will make program stop respond
What I Did
If remove the line
it will work just fine.
The text was updated successfully, but these errors were encountered: