[pyar] Servir paginas estaticas via python

Roberto Alsina ralsina en netmanagers.com.ar
Jue Oct 7 11:22:01 ART 2010


On Thursday 07 October 2010 11:10:43 Sebastian Bassi wrote:
> 2010/10/7 Daniel Moisset <dmoisset en machinalis.com>:
> > $ cd directorio_a_servir
> > $ python -m SimpleHTTPServer 8080
> > eso no te sirve?
> 
> ¿Como ejecuto eso desde Python? (sin llamarlo con subprocess).

Cito de

http://docs.python.org/library/simplehttpserver.html

import SimpleHTTPServer
import SocketServer

PORT = 8000

Handler = SimpleHTTPServer.SimpleHTTPRequestHandler

httpd = SocketServer.TCPServer(("", PORT), Handler)

print "serving at port", PORT
httpd.serve_forever()



More information about the pyar mailing list