0
urlretrieve(URL, file_path, self.reporthook)

我将 tkinter 用于 Python 3,并希望在用户按下关闭按钮时中止下载文件并关闭应用程序。

4

1 回答 1

1

您应该研究多处理。可能不是它打算做的,但应该可以在代码线程之外杀死。

https://docs.python.org/3/library/multiprocessing.html

于 2018-05-18T21:18:01.677 回答