Init.
This commit is contained in:
commit
a40d71d8d4
9 changed files with 344 additions and 0 deletions
13
demo/slow.py
Executable file
13
demo/slow.py
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env -S python3
|
||||
|
||||
from time import sleep, time
|
||||
from signal import signal, SIGINT, pause
|
||||
from sys import exit
|
||||
|
||||
def main():
|
||||
print("Now is", time())
|
||||
signal(SIGINT, lambda *_: (print("Received sigint, stopping in 5s ..."), sleep(5), exit(0)))
|
||||
print("Waiting for sigint.")
|
||||
pause()
|
||||
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue