You can use os.open command to run any script within python script it will run as it would in a command line, for example:
import os
os.open("echo 7")
#this will print 7 on the terminal when you run the script
If in case you want to capture output of a script you run and use it in the script then I suggest you use os.popen
, for example:
import os
var=os.popen("cat /path/to/file")
print(var)
#this will print the file content
So in short anything that goes in os.open("here") will run as it would in a command line or terminal of your os.
If you want to run applications you will have to sub subprocess:
import subprocess
subprocess.call("spyder")
Alternatively you can use popen as well to open files:
import os
os.popen("spyder or subl")
os.open
will not work. In regards to your specific request use the following code:
import os
os.popen("cd /home/mypc/path ; subl")