[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版
port has been made). Moreover, the Python web server classes used by the locally running server deployed for this book still doe ...
>>> import rotor >>> r = rotor.newrotor('pymailcgi') # can be decrypted in new process >>> r.decrypt( ...
This interface is similar to that of the original rotor module, but it uses better encryption algorithms. AES is a popular priva ...
Secure cookies It’s possible to replace the form fields and query parameter PyMailCGI currently gen- erates with client-side coo ...
if not forceReadablePassword: ########################################################### don't do anything by default: the urll ...
sys.stderr.write('using PyCrypto\n') from Crypto.Cipher import AES mykey = 'pymailcgi3'.ljust(16, '-') # key must be 16, 24, or ...
res += chr(ord(char) - adder) return res ############################################################################### top-lev ...
Rolling your own encryptor As is, PyMailCGI avoids ever passing the POP account username and password across the Net together in ...
This module also defines functions that dump raw CGI environment information to the browser (dumpstatepage), and that wrap calls ...
def pageheader(app='PyMailCGI', color='#FFFFFF', kind='main', info=''): print('Content-type: text/html\n') print('%s: %s page (P ...
print('Text:') print('<textarea name=text cols=80 rows=10 %s>' % extra) print('%s\n' % (cgi.escape(text) or '?')) # if has ...
def editpage(kind, headers={}, text=''): on Send, View+select+Reply, View+select+Fwd pageheader(kind=kind) print('<form encty ...
class Silent: def write(self, line): pass save_stdout = sys.stdout sys.stdout = Silent() # send print to dummy object try: # whi ...
But before we all jump on the collective Internet bandwagon and utterly abandon tra- ditional desktop APIs such as tkinter, a fe ...
The Web Versus the Desktop Of course, these systems’ specific functionality isn’t exactly the same—PyMailCGI is roughly a functi ...
HTML in a CGI script can be much less straightforward than making calls to a GUI API such as tkinter. Witness, for example, all ...
Portability benefits All you need is a browser on clients. On the upside, because PyMailCGI runs over the Web, it can be run on ...
In fact, one could make the argument that moving toward a web server architecture is akin to stepping backward in time—to the ti ...
strings of information that are stored on the client upon request from the server, and that are transferred back to the server w ...
also complicate the web development story even further, and add yet additional languages to the mix. Though this can vary, the n ...
«
62
63
64
65
66
67
68
69
70
71
»
Free download pdf