download and compile pam-python-1.0.4 (http://pam-python.sourceforge.net/) on CentOS
(python-pam is a pam client, NOT to write pam modules)
Put everything under /lib64/security, such as pam_python.so, and python pam scripts, e.g. pam_permit.py
Here is a test script. It allows you to log in as test1 with password '11'. (User test1 needs to exist on the host.) Some output will be written to /var/log/secure.
#
# Duplicates pam_permit.c