MCPcopy Create free account
hub / github.com/ActiveState/code / get_char

Function get_char

recipes/Python/578366_The_Normal_Cow/recipe-578366.py:202–215  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

200 raise Exception
201
202def get_char():
203 while msvcrt.kbhit():
204 msvcrt.getch()
205 func = False
206 char = msvcrt.getch()
207 if char in ('\x00', '\xE0'):
208 func = True
209 while func:
210 msvcrt.getch()
211 func = False
212 char = msvcrt.getch()
213 if char in ('\x00', '\xE0'):
214 func = True
215 return char.replace('\r', '\n')
216
217def get_int():
218 while msvcrt.kbhit():

Callers 1

runFunction · 0.70

Calls 2

getchMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected