[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版
file; get-style URLs don’t work for uploading files (adding their contents to the end of the URL doesn’t make sense). When we vi ...
loadtextauto = False # True=read file at once uploaddir = './uploads' # dir to store files sys.stderr = sys.stdout # show error ...
os.chmod(srvrname, 0o666) # make writable: owned by 'nobody' return filetext, srvrname def main(): if not 'clientfile' in form: ...
For uploads to be saved on the server, CGI scripts (run by the user “nobody” on some servers) must have write access to the encl ...
Notice the URL in this page’s address field—the browser translated the / character we typed into the selection page to a %2F hex ...
usually translated to + characters as well. We can often get away without manually translating most non-ASCII characters when se ...
need to be specific since the path comes from another machine. Note that we could have instead coded the path splitter logic lik ...
MIME-encoded, text of any encoding, and even arbitrary combinations of these. The current email package’s requirement to decode ...
More Than One Way to Push Bits over the Net Finally, let’s discuss some context. We’ve seen three getfile scripts at this point ...
CGI Downloads: Forcing the Issue In Example 15-27, we wrote a script named getfile.py, a Python CGI program designed to display ...
CHAPTER 16 The PyMailCGI Server “Things to Do When Visiting Chicago” This chapter is the fifth in our survey of Python Internet ...
The PyMailCGI Website In Chapter 14, we built a program called PyMailGUI that implements a complete Python+tkinter email client ...
through states such as web pages (e.g., dataflow diagrams), but for this simple example, this file gets the job done. Example 16 ...
PyMailCGI also reuses parts of the mailtools module package and mailconfig.py module we wrote in Chapter 13. The former of these ...
attachments can be viewed, sending binary and some text attachments is not supported in the current version because of a Python ...
Moreover, both text and binary attachments of fetched mails are simply saved in binary form and opened by filename in browsers w ...
outside this book’s scope, would imply a radically different and more complex program structure, and should probably not be nece ...
Even so, the list page’s headers-only download can be slow if you have many messages in your inbox (and as I confessed in Chapte ...
pseudocode,” systems are sometimes better described in Python than in English once you have the overall design in mind. Running ...
introduction to network socket addresses in Chapter 12 and the discussion of URLs in Chapter 15. If you do install this example’ ...
«
59
60
61
62
63
64
65
66
67
68
»
Free download pdf