X10Hosting is one of the few free hosting providers allowing Python. Here you will learn how to run python scripts on your website:
1: Make sure your python script has the following as the very first line:
Code:
#!/usr/bin/env python
2. Upload the file (ftp), and make sure it is set as executable: (varies depending on software)
3. Make sure the .htaccess file is set up correctly to allow python to run:
If you placed the script in the cgi-bin directory the script will run directly, otherwise you need to add the following line to the .htaccess file for the directory:
Code:
AddHandler cgi-script .py
4. Enjoy, the script should run.
Note: you should test python scripts locally, and only upload them once they are finished, since debugging on the server isn't easy.