I want to interrupt or stop running a python script by pressing a button from outside like in assembler or C. Is there any possibility to implement this?
            Asked
            
        
        
            Active
            
        
            Viewed 283 times
        
    -2
            
            
        - 
                    Does this answer your question? [How to stop/terminate a python script from running?](https://stackoverflow.com/questions/19782075/how-to-stop-terminate-a-python-script-from-running) Please note that [asking on Stack Overflow is not a substitute for doing your own research.](//meta.stackoverflow.com/a/261593/843953) – Pranav Hosangadi Mar 23 '21 at 15:28
- 
                    Unfortuanetly not. Is there a way to change the Ctrl + C Keyboard Interrupt or define it's own? – Roadrunner Mar 25 '21 at 07:56
1 Answers
0
            
            
        There is a way.
You can press control C, for both Mac and windows to interrupt a program execution.
Thank You.
 
    
    
        Shuvam Paul
        
- 120
- 4
- 
                    yes i know, but is it not possible to define it's own interrupt event, like pressing an external button? – Roadrunner Mar 24 '21 at 07:18
