Python

From Hostek.com Wiki
Jump to: navigation, search

While the Hostek support team does not provide detailed support for Python, Python does come installed on cPanel account.

To test a Python script on your cPanel account, do the following:

Create a python script file example.py with the following contents:

#! /usr/bin/python
print "Content-type: text/html\n\n"
print "Hello world!!"

Make sure the file is owned by the user and has execute permissions:

chown user.user example.py
chmod +x example.py

Add handler for python to the .htaccess file:

Options +ExecCGI
AddHandler cgi-script .py

Now you should be able to run domain.com/example.py