I\'m using Pygame/SDL\'s joystick module to get input from a gamepad. Every time I call its get_hat() method it prints to the console. This is problematic since
I use pythonw.exe (on Windows) instead of python.exe.
In other OSes, you could also redirect output to /dev/nul.
And in order to still see my debug output, I am using the logging module.