It is a 250 lines python code for reading joystick signal running on Linux. This script should work on any linux system and I only tested on Raspberry Pi.
For testing, plug in a joystick controller and type python test.py
to print out the joystick signal.