Closed Cabalist closed 6 years ago
Thanks for PEP8-ing!
I was quite surprised to see that getch() worked without a try/except. But I looked at the docs and in fact without a key press in the buffer, it returns a curses.ERR, which is not a Python error, but an innocuous -1 value. I'll probably return on a -1 anyway, since it seems inefficient to run through all the whole function each time when there's no key press.
Also, PEP8 says, "Files using ASCII (in Python 2) or UTF-8 (in Python 3) should not have an encoding declaration," so I'll remove that.
Thanks for catching all those typos, good eye!
I didn't realize that no encoding declaration was needed in a sole Python3 environment. Neat!
Just a collection of PEP8 and typo fixes. I renamed Key_handler -> KeyHandler for consistency and marked a couple methods as static. This is very cool and has worked on my various terminals. :)