14 lines
210 B
Markdown
14 lines
210 B
Markdown
|
---
|
||
|
title: Python
|
||
|
---
|
||
|
|
||
|
[toc]
|
||
|
## Exit on Keyboard Interrupt
|
||
|
```
|
||
|
try:
|
||
|
<put your code here>
|
||
|
except KeyboardInterrupt:
|
||
|
<stuff that needs to be done before exiting>
|
||
|
# return SIGINT code
|
||
|
exit(130)
|
||
|
```
|