Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- def execute_unix(inputcommand):
- p = subprocess.Popen(inputcommand, stdout=subprocess.PIPE, shell=True)
- (output, err) = p.communicate()
- return output
- if __name__ == "__main__":
- print "Welcome to PYSH version 1.0\n"
- loopy = 0
- while loopy == 0:
- inputcommand = str(raw_input('pysh-1.0a$ '))
- if inputcommand == "quit":
- loopy = 1
- continue
- print execute_unix(inputcommand)
Advertisement
Add Comment
Please, Sign In to add comment