Can someone help me with a Python command for ctrl + c

400 views Asked by At

I am running a python script on Secure CRT to capture certain data logs. My logs can be stopped by pressing ctrl+c physically on the keyboard. So far I have used the following but to no avail. Can someone tell me how to send ctrl+c as a command to secure CRT ?

  1. tab.Screen.Send("kill -2\n")

  2. import os
    import signal
    os.kill(p.pid,signal.SIGINT)
    
1

There are 1 answers

0
Rcoder98723 On BEST ANSWER

I found the answer. If anyone faces a similar issue in the future -

    tab.Screen.Send("\003")

OR

    crt.Screen.Send("\003")