Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set up Python simpleHTTPserver on Windows [duplicate]

I want to set up Python SimpleHTTPServer on Windows XP. I have Python installed on my computer. I am executing the following command:

python -m SimpleHTTPServer 8888 

But I am getting the error:

C:\Python33\python.exe: No module named SimpleHTTPServer 

Is SimpleHTTPServer for Python available on Windows? If yes, what do I do to set up the server?

like image 239
codeofnode Avatar asked Jun 27 '13 18:06

codeofnode


People also ask

What is python SimpleHTTPServer?

The SimpleHTTPServer module is a Python module that enables a developer to lay the foundation for developing a web server. However, as sysadmins, we can use the module to serve files from a directory. Usage. Python must be installed to use the SimpleHTTPServer module.


1 Answers

From Stack Overflow question What is the Python 3 equivalent of "python -m SimpleHTTPServer":

The following works for me:

python -m http.server [<portNo>] 

Because I am using Python 3 the module SimpleHTTPServer has been replaced by http.server, at least in Windows.

like image 182
codeofnode Avatar answered Oct 07 '22 12:10

codeofnode