I'm running Windows 7, and using Google Chrome as my web browser.
This is my code:
#!/usr/bin/env python
print 'content-type: text/html\n'
print """
<!DOCTYPE html>
<html>
<head>
<title> sample </title>
</head>
<body>
"""
print 2 + 3
print """
</body>
</html>
"""
In Command Prompt, where python
results in C:\Python27\python.exe
, but according to this post I should use #!/usr/bin/env python
instead.
When I try to run this .py
code in my browser, the source code appears instead of just 5
.
If someone would provide detailed instructions as to how to properly work this, I would be most grateful.
Thanks!