dimanche 16 septembre 2012

Serving content with Python SimpleHTTPServer

You just need to go to the directory you want to share its content, then type 
        $ python -m SimpleHTTPServer
        Serving HTTP on 0.0.0.0 port 8000 ...
The directory is now accessible on http://localhost:8000.

Port 8000 is default port used by python http server, however you can change it:
        $ python -m SimpleHTTPServer 5555
        Serving HTTP on 0.0.0.0 port 5555 ...

if you get python.exe: No module named SimpleHTTPServer, you're probably trying with python3.x as python modules are renamed. You should try:
$ python -m http.server

Aucun commentaire:

Enregistrer un commentaire