huwwp / cryptop

command line crypto portfolio
MIT License
235 stars 41 forks source link

key_pressed = chr(imp).upper() #26

Closed cclauss closed 7 years ago

huwwp commented 7 years ago

stdscr.getch() returns an integer, can't perform upper

cclauss commented 7 years ago

chr() converts an integer into single character str which you can do upper() on.

python -c "print(chr(65) + chr(97))" # --> 'Aa'

huwwp commented 7 years ago

My bad. getch defaults to -1 in curses no delay mode which we can't call chr on. Could wrap in another if to check before calling chr on it, current branch doesn't run for me

huwwp commented 7 years ago

It also breaks consistency on the first loop checking keycodes to later check for chr for no real gain. I'd rather not for readability.