How to stop the flow and the whole script is python3?

Made multi-threading and now ctrl+c does not stop the script just closes the window.

Example:
import threading

def scan(): 
 for line in f:
 try: 
 do_something 
 except SomeError:
pass
thread_scan1 = threading.Thread(target=scan, name='s1') 
thread_scan2 = threading.Thread(target=scan, name='s2') 
thread_scan3 = threading.Thread(target=scan, name='s3') 
thread_scan4 = threading.Thread(target=scan, name='s4') 
thread_scan5 = threading.Thread(target=scan, name='s5') 

thread_scan1.start() 
thread_scan2.start() 
thread_scan3.start() 
thread_scan4.start() 
thread_scan5.start() 

thread_scan1.join() 
thread_scan2.join() 
thread_scan3.join() 
thread_scan4.join() 
thread_scan5.join()

How to complete?
June 5th 19 at 21:22
1 answer
June 5th 19 at 21:24
God help you. There is the answer.

https://www.linux.org.ru/forum/development/5632316

Still here look, but should be sufficient to start.
https://stackoverflow.com/questions/18018033/how-t...

Find more questions by tags multithreadingPythonWindows