【问题标题】:Is it possible to stop (cancel) urlretrieve process?是否可以停止(取消)urlretrieve 进程?
【发布时间】:2018-05-18 20:47:53
【问题描述】:
urlretrieve(URL, file_path, self.reporthook)

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

【问题讨论】:

标签: python urlretrieve


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-13
    • 2012-03-11
    • 1970-01-01
    • 1970-01-01
    • 2022-12-06
    • 2017-04-13
    • 1970-01-01
    相关资源
    最近更新 更多