Image

Python — cross-platform programming language with dynamic strong typing, focused on improving developer productivity, code readability and code quality. The language is quite simple and is very popular with the developer community for writing simple scripts.

In hosting, it works through the CGI module, in order to make sure that it is enabled, go to the control panel in the section Hosting settings.


Next, place the script in a special CGI-BIN folder, which is located at the root of your domain:

test.py (following content)

#! /usr/bin/python
print "Content-type: text/html"
print
print "<html><head><title>Test Python</title></head><body><pre>"

import sys
sys.stderr = sys.stdout

import os
from cgi import escape
print "<strong>Python %s</strong>" % sys.version
keys = os.environ.keys( )
keys.sort( )
for k in keys:
print "%s\t%s" % (escape(k), escape(os.environ[k]))
print "</pre></body></html>"

After you need to set the correct permissions for the file, they should be 755. This can be done via ftp, file manager or ssh. Check the script by opening the link http://your-domain.tld/cgi-bin/test.py

The script will display information about the python version and variables.