I'm using Python code as an application with pyinstaller.
There are times when you copy and paste messages that appear on the console, and pressing ctrl c several times to copy causes the window to turn off.
Can I set the key to ignore when I press ctrl c or to exit the process to a different key?
CTRL+C is to send a SIGINT signal to the process, so you can write a corresponding code for the signal.
import signal
def signal_handle(signum, f):
pass
signal.signal(signal.SIGINT, signal_handle)
while(True):
q = input("enter : ")
if q is not '': print(f":D {q}")
© 2024 OneMinuteCode. All rights reserved.