

#!/usr/bin/pythonX
print "Content-type:text/html\r\n\r\n"
print "How to run Python scripts in cPanel"
whereis python command via SSH to check the directory.Options +ExecCGI
AddHandler cgi-script .py

touch nctest.py ls
chmod 755 /home/cPuser/public_html/cgi-bin/nctest.py
nano nctest.py# !/usr/bin/python
print "Content-type:text/html\n\n"
print "How to run Python scripts in cPanel"
whereis python command via SSH to check the directory.
touch .htaccess

nano .htaccess and add the following code:
Options +ExecCGI
AddHandler cgi-script .py

Need help? We're always here for you.