Daniel Slater has a couple of posts of interest to AI game followers:
How to run learning agents against PyGame
Deep-Q learning Pong with Tensorflow and PyGame
If you like low-end video games… 😉
Seriously, the principles here can be applied to more complex situations and video games.
Enjoy!