Wednesday, August 31, 2011

One line web server using Python


Python 2.x:
python -m SimpleHTTPServer

Python 3.x: *
python -m http.server 8000


From http://www.garyrobinson.net/2004/03/one_line_python.html

*The 3.x option doesn't work for me as I have no "http" module, but I can use:
python -m BASEHTTPServer instead, pydoc -k http will show all modules with http in the name.

No comments:

Post a Comment