I have to call a long run process from a bottle script (web framework like Django).
So in a bottle script i have
os.system("python /home/tom/Documents/proc_test/main.py")
Anyway the main.py script is not executed. How can i call a python script from another running python program?
P.S: in python shell interpreter i have write os.system("python /home/tom/Documents/proc_test/main.py") and the file is called
execit ?exec(open("/home/tom/Documents/proc_test/main.py").read())It will work only if the file is executable though. Not related, but I prefer to use thesubprocessmodule to execute binaries.os.systemorsubprocess. But unless you have a compelling reason to run it as a distinct process, you should probably just import the script as a module and call it's entry point (assuming it's correctly written so it can be used that way).