python网页基本元素

#!/usr/bin/python
import time
import cgi
def printHeader(title):
 print """Content-type: text/html

 

<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>%s</title></head>

<body>""" % title
printHeader("Current date and time:")
print time.ctime(time.time())
print """</body></html>"""

 

你可能感兴趣的:(python,网页,元素,title)