问题
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