Is that possible to expose some functions which can be called by python?

Hi all, I want to build a reinforcement learning AI for my game, and I need run the game thousands of times to collrct the training data.
I will use pytorch as deep learning framework, I want to know how can the python scripts launch the game and get the intermediate data.
Appreciate for any response!