Running from another script

How would I run from another python script

piborg's picture

It is fairly easy to run any terminal command from with a python script.

First make sure you have the os module imported:

import os

Now you can use os.command with a string like so:


This will run the script and wait for it to finish.

You can add & at the end to run the script and carry on without waiting:

os.system('/home/pi/monsterborg/ &')

Many Thanks!

Subscribe to Comments for "Running from another script"