xiaxia

对以上的补充

#!d:\Python24\python.exe
#
 Fig. 6.3: fig06_03.py
#
 Displays the current date and time in a Web browser.

import time

def printHeader( title,mail,name):
   
print """Content-type: text/html

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

<body>%s
""" % (title,mail,name)

printHeader( 
"Current date and time" ,"ipap@ipaper18.com","Array")
print "<p>" + time.ctime( time.time() ) + "</p>"
print "</body></html>"


试着运行.注意%S的变化..

posted on 2006-09-01 11:07  Array  阅读(133)  评论(0编辑  收藏  举报

导航