import subprocess import os import sys ''' A simple python shell Author: @OsandaMalith ''' while True: try: Input = raw_input("Osanda> ") cmd = Input.split() proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) o, e = proc.communicate() print (o.decode('ascii')) print(e.decode('ascii')) except Exception, e: continue except KeyboardInterrupt: sys.exit("\nClosing shell...")