On Tue, 2004-02-24 at 13:35, Phil Hunt wrote:
I am trying to get my head round Twisted, particularly to use it as a simple web server (using http as a RPC mechanism, really). I was thinknig of using a "Rosetta Stone" approach, and am wondering if someone could translate this ordinary Python program into Twisted, please:
Attached are two examples of what you've described, both of which are a lot easier on the eyes than SimpleHTTPServer code. rosetta1 just uses twisted.web's Resource object, which is relatively basic in its capabilities. If you want more scalable and flexible templating and web application design, you might want to start working with Nevow, which is what rosetta2 demonstrates. Both of these scripts should be run using the following command: $ twistd -ony rosettaX.tac.py Hope this helps. -- Alex Levy WWW: http://mesozoic.geecs.org "Never let your sense of morals prevent you from doing what is right." -- Salvor Hardin, Isaac Asimov's _Foundation_