If the default python on your machine is python 3 so running the following command will result an error:
So use instead:
The python 2.7 doc warns:
You can also check the python 3.5 doc.
Note that on some machines
python redirects to python 2 and on some others to python 3, so if you want a command that always works use
python3 -m http.server or
python2 -m SimpleHTTPServer.