Running monsterjoy.sh from another script

Hello,
How would I run monsterjoy.sh from another python script
Thanks!

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:

os.system('/home/pi/monsterborg/runMonsterJoy.sh')

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/runMonsterJoy.sh &')

Many Thanks!

Subscribe to Comments for "Running monsterjoy.sh from another script"