Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
urlretrieve(URL, file_path, self.reporthook)
我将 tkinter 用于 Python 3,并希望在用户按下关闭按钮时中止下载文件并关闭应用程序。
您应该研究多处理。可能不是它打算做的,但应该可以在代码线程之外杀死。
https://docs.python.org/3/library/multiprocessing.html