FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Python hello world





noob1001
This has been my experience with setting up a python script on server 4... so far.


First in ur public_html folder create a '.htaccess' file with the folowing:
Code:
SetHandler mod_python
PythonHandler mod_python.publisher
PythonDebug On


then place ur python file in there as well.
My test hello.py:
Code:

import sys

def index():
   s = "<html><body><h2>Hello World!</h2></ br>%s</body></html>" %sys.version
   return s


Then set the permission of ur .py file to 755 to make it executable
Good luck
90dota
i done what you done in my frihost but i am failed

it was show that:

"
Not Found

The requested URL / was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2 Server at china.frihost.org Port 80

"
noob1001
Have u used the correct url request? In my example it ur website address + the name of the .py file
www.(domainname).org/hello
Related topics
Running a "Hello World" php script
python script???
hello world
Hello World!
Python beginners help!
Python CGI work with FRIHOST
::Hello, World::
Hello
Basic VB Tutorial - "Hello World"
Is there a Python Hello World using Apache?
Hello World
Hello, world
displaying Hello world
Hello world
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.