Joss
Joss

Reputation: 106

Is it possible to stop (cancel) urlretrieve process?

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.

Upvotes: 0

Views: 193

Answers (1)

pypalms
pypalms

Reputation: 461

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

Upvotes: 1

Related Questions