R
ryan
1) i have a function that i made in one of my program's modules named
"input_box.py" that uses unicode:
def get_key():
while 1:
event = pygame.event.poll()
if event.type == KEYDOWN:
ev_unicode = event.unicode
if type(ev_unicode) == types.UnicodeType:
if ev_unicode == '':
ev_unicode = 0
else:
ev_unicode = ord(ev_unicode)
value = unichr(ev_unicode).encode('latin1')
return (event.key, value)
else:
pass
------------------
2) i use py2exe to compile it with the option for encodings, like the docs
say:
python setup.py py2exe --packages encodings
--------
3) I still get the error:
Traceback (most recent call last):
File "<string>", line 110, in ?
File "<string>", line 82, in main
File "handle_keyboard.pyc", line 113, in handle_keyboard
File "open_url.pyc", line 126, in open_url
File "input_box.pyc", line 53, in ask
File "input_box.pyc", line 21, in get_key
LookupError: no codec search functions registered: can't find encoding
"input_box.py" that uses unicode:
def get_key():
while 1:
event = pygame.event.poll()
if event.type == KEYDOWN:
ev_unicode = event.unicode
if type(ev_unicode) == types.UnicodeType:
if ev_unicode == '':
ev_unicode = 0
else:
ev_unicode = ord(ev_unicode)
value = unichr(ev_unicode).encode('latin1')
return (event.key, value)
else:
pass
------------------
2) i use py2exe to compile it with the option for encodings, like the docs
say:
python setup.py py2exe --packages encodings
--------
3) I still get the error:
Traceback (most recent call last):
File "<string>", line 110, in ?
File "<string>", line 82, in main
File "handle_keyboard.pyc", line 113, in handle_keyboard
File "open_url.pyc", line 126, in open_url
File "input_box.pyc", line 53, in ask
File "input_box.pyc", line 21, in get_key
LookupError: no codec search functions registered: can't find encoding