⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 courseshow.py

📁 python web programming 部分
💻 PY
字号:
#
# $Workfile: CourseShow.py $ $Revision: 3 $
# $Date: 10/07/01 1:37p $ $Author: Sholden $
#
import Courses
from Error import Error
from cachequery import CacheQuery
from dbsource import dbsource

conn = dbsource().conn
cursor = conn.cursor()

qCrs = CacheQuery("Course", Courses.CrsNames, ("CrsNum", ),
                     conn, refresh=30)

class Page(Courses.Page):

    def Body(self):
        if not self.path:
            raise Error(404, "Not Found", errmsg="No course number")
        crsNum = self.path[0]
        c = qCrs(crsNum)[0]
        a = Courses.qIns(c.CrsAuthor)[0]
        return """
    <P>Course %d : %s : $%d [<A HREF="/CourseByNum/%s/">Schedule</A>]</P>
    <P>%s</P>
    <P><FONT SIZE="-2">This course, written by <A HREF="/Instructor/%d/">%s</a>, can
        accommodate a maximum of %d students.</P>""" % \
                (c.CrsNum, c.CrsTitle, c.CrsPrice, c.CrsNum, c.CrsDescription,
                        c.CrsAuthor, a.InsName, c.CrsPlaces)



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -