-4

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 !

4
  • 2
    Please do not paste screenshots in your questions. Paste the actual text messages. Commented Aug 21, 2018 at 15:33
  • This question is surely a dupe. Commented Aug 21, 2018 at 15:35
  • The linked question isn't an exact duplicate, but it's essentially the same problem: trying to run something inside the Python interactive interpreter that actually needs to be run in the OS command prompt. Commented Aug 21, 2018 at 15:39
  • Please see Why may I not upload images of code on SO when asking a question? Commented Aug 21, 2018 at 15:39

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I seriously don't know why it didn't work in the first place, but thank you very much!
@MarcSzy You were trying to run that system command in the Python interpreter... You can tell by the three greater than signs at the prompt (>>>). Please accept (grey --> green arrow next to this answer) since it fixed!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.