Python threads with os.system() calls. Main thread doesn't exit on ctrl+c
问题 Please don't consider it a duplicate before reading, There are a lot of questions about multithreading and keyboard interrupt , but i didn't find any considering os.system and it looks like it's important. I have a python script which makes some external calls in worker threads. I want it to exit if I press ctrl+c But it look like the main thread ignores it. Something like this: from threading import Thread import sys import os def run(i): while True: os.system("sleep 10") print i def main():