root / trunk / sandbox / jhb / webwallet / cgiserver.py

Revision 327, 445 bytes (checked in by ocjhb, 3 years ago)

webwallet can now do basic actions

  • Property svn:mime-type set to text/plain
  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1# File: cgihttpserver-example-1.py
2
3import CGIHTTPServer
4import BaseHTTPServer
5
6class Handler(CGIHTTPServer.CGIHTTPRequestHandler):
7    cgi_directories = [""]
8
9
10def address_string(self):
11    host, port = self.client_address[:2]
12    return host
13
14Handler.address_string = address_string
15
16PORT = 9091
17
18
19httpd = BaseHTTPServer.HTTPServer(("", PORT), Handler)
20httpd.address_string = address_string
21print "serving at port", PORT
22httpd.serve_forever()
Note: See TracBrowser for help on using the browser.