*I am working on a python script(test.py) which needs to handle ctrl+c and
ctrl+z. using signal handler(signal.signal) to achieve this. when the
script is executed directly ie., python3 test.py ,ctrl+c and ctrl+z are
getting handled.*
*cat test.py*
*import signal *
* import time*
* def handler_c(signum, frame):*
* print("caught ^C") *
* def handler_z(signum, frame): *
*print("caught ^Z") *
*def test(): *
* signal.signal(signal.SIGINT, handler_c) *
* signal.signal(signal.SIGTSTP, handler_z) *
*time.sleep(50) *
* test()*
*output:*
*python3 test.py*
*^Ccaught ^C *
* ^Zcaught ^Z *
* ^Ccaught ^C*
*when a binary is generated with pyinstaller for the above script and tried
to interrupt the binary execution with ctrl+c and ctrl+z, ctrl+c got
handled properly. but ctrl+z is not handled properly. Though the handler
got executed, the process is getting suspended.*
*# pyinstaller --onefile test.py./dist/test (test is the binary generated
with pyinstaller)^Ccaught ^C^Zcaught ^Z[1]+ Stopped
./dist/test*
*Version:*
*Python 3.6.8, *
*PyInstaller: 4.10*
*how to handle ctrl+z in the binary generated with pyinstaller?*
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyinstaller/3c69e082-fb77-44d4-9f98-6c2b89db214bn%40googlegroups.com.