Python supports CGI scripts on shared Linux servers.
To run Python scripts you should first make sure of the following steps:
Step 1: Add cgi-bin as cgi-dir in the control panel on the web services section for the domain.
Step 2: Add the .py extension for Python to run against CGI on the web services section for the domain.
Step 3: Place the script inside the cgi-bin directory and make sure that the cgi-bin directory and files in it have permission of 755 to run.
Step 4: Use the shebang at the top => #!/usr/bin/python and then write the script you want and then run it on the browser using the url :-
http://domainname/cgi-bin/python-script.py
That’s it! Your Python script should work fine if you have followed the steps above.
]]>