Sunday, October 4, 2009

how to start a simple HTTP server using Python

In python 2.6, just type the following command in the directory where the files to be served are:

python -m SimpleHTTPServer

In Python 3.0, SimpleHTTPServer has been merged into http.server, so change the argument to -m to http.server.SimpleHTTPRequestHandler

No comments: