I am learning python at college. I have got a very stupid question. How do i make a web page with python?
I do this and save as test.py
print "Hello test \n";
print "\n"
print "Just testing \n";
When i go to the url I get the same output
print "Hello test \n";
print "\n"
print "Just testing \n";
I am really confused. What am i doing wrong? My hosting is with hostgator. On their web site it says to do like this:
#!/usr/bin/python
print "Content-type: text/html\n\n";
print "<html><head>";
print "<title>CGI Test</title>";
print "</head><body>";
print "<p>Test page using Python</p>";
print "</body></html>";
this gives me the same error.
Ok. it works perfect.
There were some problems with whole thing.
1- The problem i was getting with hostgator was:
2- I had to add
to my .htaccess file
I edited again on notepad++ and added htaccess file then it worked.
The problem i was having on local is sorted aswell.
I had apache on memory stick.
All i had to do is
1- add this to apache:
2- add .py to end of this line
3- Add the python path at the beginning of my oy file