Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for bashfile in files:
- p = Popen(bashfile, cwd=dname) #dname is the current directory of the script
- stdout, stderr = p.communicate()
- os.system("""here some code you use to execute in Terminal""")
- import commands
- cmd="bash ./script.sh"
- commands.getoutput(cmd)
- cmd = "/path/to/your/script/script.sh"
- fun_times = commands.getoutput("bash ./script.sh")
- not_fun_times = os.system("./script.sh")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement