python - How to quit from input() function after call codecs.getreader for stdin? -
i try read windows console utf-8 letters.
i have code follows:
import codecs sys.stdin = codecs.getreader('utf-8')(sys.stdin) if __name__ == '__main__': print 'query=', query = sys.stdin.readline() print query
but there strange thing:
after pressing enter button execution of stdin.readline()
or raw_input()
or input()
functions not stop.
what do wrong? or how send eof()
stop input console in case?
on mac, hitting ^d (ctrl-d) twice trick. not sure if work across systems, give shot.
Comments
Post a Comment