November 2005
ASPN : Python Cookbook : Simple HTTP server supporting SSL secure communications
by roberto & 1 otherThis recipe describes how to set up a simple HTTP server supporting SSL secure communications. It extends the SimpleHTTPServer standard module to support the SSL protocol. With this recipe, only the server is authenticated while the client remains unauthenticated (i.e. the server will not request a client certificate from the browser). So, the client (typically the browser) will be able to verify the server identity and secure its communications with the server.
October 2005
ASPN : Python Cookbook : Simple web request benchmark
by robertoThis recipe measures the amount of time to perform each portion of a request to a single file many times, and prints the results in a somewhat reasonable fashion.
ASPN : Python Cookbook : Generator Based Concurrency, with Real Threads when Needed.
by robertoThis recipe uses NanoThreads. http://lgt.berlios.de/
It shows how simulated concurrency, (using generators as tasks), can be transparently combined with OS Level Python threads, as and when needed.
ASPN : Python Cookbook : List comprehensions for database requests
by robertoThe usual way to make a request to a database is to write a string with the SQL syntax, then execute this request and get the result as a list with cursor.fetchall() or cursor.fetchone()
Python has list comprehensions to select items in an iterable if a certain condition is true ; this is very similar to database requests
This recipe wraps a table of a DB-API compliant database in a class that implements the iteration protocol, so that you can use the for ... in ... if ... syntax
October 2004
1
(5 marks)