Insert hosts and host variables into a python script

Hello,

Is it possible to take a hostname and other information in the hosts file and insert each one into a python file as an ansible playbook runs the python file for each host?

Yes it possible.