html.py
来自「python web programming 部分」· Python 代码 · 共 26 行
PY
26 行
#
# $Workfile: HTML.py $ $Revision: 1 $
# $Date: 8/29/01 3:14p $ $Author: Sholden $
#
import Dept
import os
class Page(Dept.Page): # XXX Need a little more structure here?
def Title(self):
return "[Whoops, what do we return here?]"
def Body(self):
try:
filepath = os.sep.join(self.path)
f = open(filepath, "rb")
img = f.read()
return img
except IOError:
return """<B><I>This should be a 404 error.<BR>
Could not find file %s</I></B><BR>
Path is: %s""" % (filepath, self.path)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?