2

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)
    
ti7
  • 16,375
  • 6
  • 40
  • 68
  • Note that Control-C causes the terminal to send SIGINT to every process in the current process *group*, not just the current process as in your second example. – chepner Apr 21 '22 at 17:33

1 Answers1

1

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

    tab.Screen.Send("\003")

OR

    crt.Screen.Send("\003")