Example input script
import time
for i in range(5):
print("LOADING " + str(i))
time.sleep(1)
for i in range(10):
print("RUNNING " + str(i))
time.sleep(1)
Need a way to run launch the script, preferably python 3 subprocess and monitor and print the output continuously and terminate it as soon as it starts printing 'RUNNING', similar to sending CTRL+C in terminal
There are similar solution but nothing seems to be serving this purpose How to terminate a python subprocess launched with shell=True