Python scripts can be ran on our servers within your cgi-bin folder. In this article, we'll show you how to setup a basic 'Hello World' python script.
1. The first thing you'll need to do is create hello_world_python.py. Using either the File Manager (of use ftp), create a file named hello_world_python.py. This file should be created in your cgi-bin folder.
2. Edit the hello_world_python.py file and input the following code:
print "Content-Type: text/html"
<title>Python - Hello World</title>
3. After saving the file, change the permission of hello_world_python.py to 755. Within the File Manager, you can do this by right-clicking on the file and choosing "Change Permissions". Then, set the values to 755.
4. After updating file's permissions, visit yourdomain.com/cgi-bin/hello_world_python.py in your browser. You should see "Hello World" printed to the screen!