self.output = output_handle

def readline(self):
    result = self.input.readline()
self.output.write(result)
return result
if __name__ == '__main__':
    if not sys.stdin.isatty():
        sys.stdin = Tee(input_handle=sys.stdin, output_handle=sys.stdout)
a = input('Type something: ')
b = input('Type something else: ')
print('You typed', repr(a), 'and', repr(b))
Input redirection with python