Document checkKey slightly.
more docstrings.
sound good
Bad command line interfaces only support short options.
Use a keyword argument to make the code easier to understand.
Drop the pointless encode/decode steps.
Avoid the repetition.
another docstring
Pass by keyword for readability.