I am attempting to run a python script located in a folder on my server from another python script. The location of the script I am attempting to run is not in the same location as the existing script. The script I am trying to execute is not a function I just need it to start once the first one has completed, and I know they both work independently of each other. I have found a similar post but I get the error Not Found
when I use either os.system
or subprocess.Popen
.
I know that the directory I am calling is correct because in the previous statement I call a shutil.move
to move a file to the same directory the scipt I would like to run is in.
This is what I have tried:
subprocess.Popen("/home/xxx/xxxx/xxx/xx/test.py")
os.system("/home/xxx/xxxx/xxx/xx/test.py")
subprocess.Popen("/home/xxx/xxxx/xxx/xx/test.py", shell=True)