#NEWLINE# def input( self , input ) : #NEWLINE# #INDENT# _stdout = sys . stdout #NEWLINE# sys . stdout = self . stream #NEWLINE# self . write ( input ) #NEWLINE# self . buffer += input #NEWLINE# if ( '\n' in self . buffer ) : #NEWLINE# #INDENT# ( source , self . buffer ) = self . buffer . rsplit ( '\n' , 1 ) #NEWLINE# self . source . append ( source ) #NEWLINE# prompt = self . runsource ( '\n' . join ( self . source ) ) #NEWLINE# if prompt : #NEWLINE# #INDENT# self . write ( '... ' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . source = [ ] #NEWLINE# self . write ( '>>> ' ) #NEWLINE# #UNINDENT# #UNINDENT# sys . stdout = _stdout