[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版

(yzsuai) #1

The Root Page


Let’s start off by implementing a main page for this example. The file shown in Exam-
ple 16-2 is primarily used to publish links to the Send and View functions’ pages. It is
coded as a static HTML file, because there is nothing to generate on the fly here.


Example 16-2. PP4E\Internet\Web\PyMailCgi\pymailcgi.html



PyMailCGI Main Page

PyMailCGI


A POP/SMTP Web Email Interface


Version 3.0 June 2010 (2.0 January 2006)





Actions






Overview




alt="[Book Cover]" border=1 hspace=10>

This site implements a simple web-browser interface to POP/SMTP email
accounts. Anyone can send email with this interface, but for security
reasons, you cannot view email unless you install the scripts with your
own email account information, in your own server account directory.
PyMailCgi is implemented as a number of Python-coded CGI scripts that run on
a server machine (not your local computer), and generate HTML to interact
with the client/browser. See the book Programming Python, 4th Edition
for more details.




Notes


Caveats: PyMailCgi 1.0 was initially written during a 2-hour layover at
Chicago's O'Hare airport. This release is not nearly as fast or complete
as PyMailGUI (e.g., each click requires an Internet transaction, there
is no save operation or multithreading, and there is no caching of email
headers or already-viewed messages). On the other hand, PyMailCgi runs on
any web browser, whether you have Python (and Tk) installed on your machine
or not.

Also note that if you use these scripts to read your own email, PyMailCgi
does not guarantee security for your account password. See the notes in the
View action page as well as the book for more information on security policies.

The Root Page | 1239