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.
lighpttdor Apache) so that it executes your Python file when you retrieve your URL.