2

I am trying to follow this tutorial, in which he executes python scripts on server side, and generates HTML code using just print, here is my code:

print 'Content-Type: text/HTML';
print;
print '<h1>Hello World</h1>';

But when I go to http://localhost:5500/mysite/tests/helloworld.py it literally just shows the source code, not like the tutorial.

In the tutorial he uses XAMPP, but I am using WAMPP.

What should I do?

Meowtwo 117
  • 72
  • 1
  • 5
  • WAMPP stands for "Windows Apache MySQL PHP Perl". Python is not part of the package. – Sverri M. Olsen Jun 29 '15 at 04:41
  • Actually WAMP in WAMPServer stands for Windows Apache MySQL PHP while XAMPP stands for Windows Apache MySQL PHP, Perl. But you are right Python does not come by default on either of these – RiggsFolly Jun 29 '15 at 15:07

2 Answers2

0

Maybe WAMPP doesn't have Python module enabled/installed by default.

Please check this topic: How to install Python with Wampserver

to learn how to install and enable Python module in a WAMPP environment.

Community
  • 1
  • 1
Snake
  • 106
  • 1
  • 10
0

You need to configure cgi for your web-server: http://httpd.apache.org/docs/2.2/howto/cgi.html and run .py files in cgi-bin.

Alex Ivanov
  • 695
  • 4
  • 6