Sure you can!
Did you already install the KUAL launcher app? If not, follow the instructions here:
https://www.mobileread.com/forums/sho...reensaver+hack
You will need to install kindle jailbreak, Kindlet Jailbreak & Shared Developer Keys, as the thread says, before installing KUAL itself. Pay attention to choose the installation files that fits your device model. Read carefully all the thread content before starting.
Then, you will grab python installer from here:
https://www.mobileread.com/forums/sho...reensaver+hack
and install it through the same "Update Kindle" procedure. Then you will be ready to create in seconds a custom KUAL app launcher for your python script!