Install python and run python scripts with apache on your CentOS WebPanel server.

Install python

yum install python

Check python version

python -V

Create a test script

cd /home/USERNAME/public_html
mkdir cgi-bin
nano cgi-bin/

Now add the following python test script in the file:

# enable debugging
import cgitb
print "Content-Type: text/plain\r\n\r\n"
print "Hello World!"

Update file and folder cgi-bin permissions

chown -R USERNAME.USERNAME /home/USERNAME/public_html/cgi-bin
chmod +x /home/USERNAME/public_html/cgi-bin/

Now create .htaccess file to handle this script.
Add this test code bellow in your file /home/USERNAME/public_html/cgi-bin/.htaccess

Options +ExecCGI
AddHandler cgi-script .py

Now you can run your python script by using URL