No module named SimpleHTTPServer [Error]

Standard

I wanted to set up Python SimpleHTTPServer on my Windows 8 and I had Python installed on my computer. I was executing the following command

python -m SimpleHTTPServer 

Or(if you want to specify which port to open the application from)

python -m SimpleHTTPServer [<portNo>]

But I got the error:

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

error

Because I am using Python 3 the module SimpleHTTPServer has been replaced by http.server at least in Windows. So the following worked for me

python -m http.server [<portNo>]

soln

You will see the below screen. To test if it is working, go to http://localhost:8000/ and you should see a web page opening up.

final working

Hope that helped. Thanks!

Lima Kilo

Advertisements

Finding a computer’s model using command prompt & terminal

Standard

May be you want to find out the drivers for your PC and you need to be specific, you have to have the model of your PC. It’s fairly simple.

A. On Windows Command Prompt:

wmic csproduct get name

On my machine that returns two lines, one saying Name and another with my machine’s model name:

Dell Inspiron 15 N5040

Now that’s cool!!

B. For Linux Terminal:

sudo dmidecode | grep -A3 '^System Information'

1

This is what you get:

2

Hope it helped.

Cheers!

Lima Kilo