Is it possible to stop (cancel) urlretrieve process?

回眸只為那壹抹淺笑 提交于 2021-02-08 09:51:57

问题


urlretrieve(URL, file_path, self.reporthook)

I use tkinter for Python 3 and want to abort downloading a file and close the application when user press close button.


回答1:


You should look into multiprocessing. May not be what it was intended to do, but it should be possible to kill off outside of the code thread.

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



来源:https://stackoverflow.com/questions/50419057/is-it-possible-to-stop-cancel-urlretrieve-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!