0
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.

Joss
  • 106
  • 1
  • 2
  • 8
  • 1
    This is an interesting question. I think that your best bet would be to look into [Tkinter threading & events](https://stackoverflow.com/questions/22596975/terminate-the-thread-by-using-button-in-tkinter). – Daniel R. Livingston May 18 '18 at 20:54

1 Answers1

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

pypalms
  • 461
  • 4
  • 12