I'm on linux, and I have one python script that I want to call from another python script. I don't want to import it as a module (for a layer of security, and now for an academic exercise because I want to figure this out), I want to actually have one script call the other with os.system() or another function like that, and have the other script return a list of tuples to the first script.
I know this might not be the optimal way to do it, but I'd like to try it out, and learn some stuff in the process.
You can use subprocess
:
subprocess.call(["python", "myscript.py"])
This will also return the process return value (such as 0 or 1).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With