Created
October 3, 2019 10:15
-
-
Save OsandaMalith/5ab6f77b85d3db680a3c67d8a81348cb to your computer and use it in GitHub Desktop.
Revisions
-
OsandaMalith created this gist
Oct 3, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ 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...")