Advertisement
beezing

Minimal Python CGI code

Feb 8th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. # Don't forget to set executable flag of the script file (using chmod)
  4. # or the script won't be executed and viewed as regular text file.
  5.  
  6. # new line MUST be explicit
  7. print "content-type: text/html;\n"
  8. print "<!doctype html>"
  9. # HTML content starts here
  10. print "<html><body><h1>My python script works!</h1></body></html>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement