-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorry how can I stop the program ? #19
Comments
To stop a program , you can use the 'signal' module to catch interrupt signals (such as CTRL+C) and set an event defined in 'neonize.event'. Here is a clearer explanation of how it works: First, import 'event' from 'neonize.event' and the 'signal' module:
Next, define the 'interrupted' function that will set the event when an interrupt signal is received:
Register this function as the signal handler for SIGINT (keyboard interrupt):
With this explanation, when you press CTRL+C, the 'interrupted' function will be called, which will set the 'event' from 'neonize.event'. You can then check the status of this event in the program loop to determine if the program should stop. Make sure to handle any necessary cleanup before the program fully stops. |
I just run the example/basic.py and first I thought it was my windows and I try with my Ubuntu Server it still running cannot interrupted idk why |
No description provided.
The text was updated successfully, but these errors were encountered: