Example #1
0
 def getchar(echo):
     rv = msvcrt.getch()
     if echo:
         msvcrt.putchar(rv)
     _translate_ch_to_exc(rv)
     if PY2:
         enc = getattr(sys.stdin, 'encoding', None)
         if enc is not None:
             rv = rv.decode(enc, 'replace')
         else:
             rv = rv.decode('cp1252', 'replace')
     return rv
Example #2
0
 def getchar(echo):
     rv = msvcrt.getch()
     if echo:
         msvcrt.putchar(rv)
     _translate_ch_to_exc(rv)
     if PY2:
         enc = getattr(sys.stdin, 'encoding', None)
         if enc is not None:
             rv = rv.decode(enc, 'replace')
         else:
             rv = rv.decode('cp1252', 'replace')
     return rv
Example #3
0
 def getchar(echo):
     rv = msvcrt.getch()
     if echo:
         msvcrt.putchar(rv)
     _translate_ch_to_exc(rv)
     if PY2:
         enc = getattr(sys.stdin, "encoding", None)
         if enc is not None:
             rv = rv.decode(enc, "replace")
         else:
             rv = rv.decode("cp1252", "replace")
     return rv
Example #4
0
 def getchar(echo):
     rv = msvcrt.getch()
     if echo:
         msvcrt.putchar(rv)
     _translate_ch_to_exc(rv)
     return rv