#!/usr/bin/python import readline import threading import time import GlobalVariables class InputShell(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run (self): #outputShell= OutputShell() #OutputShell.start(outputShell) while(GlobalVariables.UserInput!="exit" and GlobalVariables.UserInput != "EXIT"): dummy=raw_input("SHELL>>> ") if(GlobalVariables.UserInput!="exit" and GlobalVariables.UserInput != "EXIT"): GlobalVariables.UserInput = dummy else: break time.sleep(0.7) print "EXITING INPUTSHELL... press to exit" class OutputShell(threading.Thread): lastvar='' def run (self): while(GlobalVariables.UserInput!="exit" and GlobalVariables.UserInput != "EXIT"): if(GlobalVariables.UserInput!=self.lastvar): print "\n(SHELL) You entered:",GlobalVariables.UserInput #sys.stdout.write( "SHELL2 >>>") self.lastvar=GlobalVariables.UserInput print "EXITING OUTPUTSHELL...press to exit " #sys.exit(0)