I am writing a script which uses subprocess to launch a server and then continues on with the execution of the script. This is my current code
cmd = "some command"
process = check_output(cmd, shell=True, stdin=None, stdout=None, stderr=None, close_fds=True)
time.sleep(70)
print(process.returncode)
I am using time.sleep to delay the execution of the next lines in the script so that the server starts but this is not efficient.
Once the server starts, I get this output in the console: INFO:bridge_serving!
Is there a way that i can check the output of the console and once it says INFO:bridge_serving!
the next lines of the script should continue running.