Python: stop code on keyboard interrupt

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
471
1. I am using python2.7, RPi2 board.
2. I have several files in my entire code. e.g there is main.py file, then it calls functions from another adc.py file & so on.In graph.py, file, a graph get initialized & started to print.
3. Problem is if code is running & I press ctrl+z on terminal, code gets stop & graph gets remain on screen. It dont get close.
4. I have a defined a except:keyboardInteruupt in main.py also in which I had closed the graph. But graph dont et closed i guess its because control might be in any other file.
How do that?
 
Top