Search code examples
pythonpython-3.xsimplehttpserver

Python3 http.sever invalid syntax


A Screenshot of the result

Hello everyone! I am trying to get a basic python server running. But unfortunately it doesn't work and after hours of googling I have simply no clue.

I installed Python3, checked the version and differed the syntax, but it's no use: It always gives me an "invalid syntax" error. Anyone who knows what's going wrong?

thanks in advance !


Solution

  • You have to use that command on the command line:

    i.e.

    C:\Users\Marc>python -m http.server
    

    this command calls the Windows equivalent directory of the Unix: /usr/lib/python3.x/http/server.py. So something like: C:\Python3x\Lib\http\server.py.