I have a python script. Which is running as a service with a while loop for ever. The script need to be executed by another python but without waiting for the out put it should pass through.
So the main script with while loop is as follows "main.py". Which never going to be end.
while True:
# do some task
time.sleep(5)
This need to be executed by another python "start.py" with similar function as follows.
os.system("main.py 1")
OR
subprocess.Popen("python main.py")
Problem here "start.py" won't finish as witing for the out put of "main.py". But I want to make it like "start.py" need to load "main.py" and leave it in background. Then the "start.py" need to complete the process. How can I modify the
os.system("main.py 1")
function to skip the waiting for "main.py"? Please consider this need to run on cross platform.