Advertisement
Guest User

Untitled

a guest
Apr 15th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. for bashfile in files:
  2. p = Popen(bashfile, cwd=dname) #dname is the current directory of the script
  3. stdout, stderr = p.communicate()
  4.  
  5. os.system("""here some code you use to execute in Terminal""")
  6.  
  7. import commands
  8. cmd="bash ./script.sh"
  9. commands.getoutput(cmd)
  10.  
  11. cmd = "/path/to/your/script/script.sh"
  12.  
  13. fun_times = commands.getoutput("bash ./script.sh")
  14.  
  15. not_fun_times = os.system("./script.sh")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement