Created
April 2, 2014 15:37
-
-
Save davepape/9936615 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Simple CGI python script that generates a web page dynamically | |
print '''Content-type: text/html | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>web page</title> | |
</head> | |
<body> | |
<p> | |
Hello, world | |
</p>''' | |
import random | |
x = random.uniform(1,100) | |
print '<p>Your lucky number is %d.</p>' % x | |
print '''<p> | |
<a href="http://validator.w3.org/check?uri=referer">[validate html]</a> | |
</p> | |
</body> | |
</html> | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment