-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 !

DYZ
  • 55,249
  • 10
  • 64
  • 93
Marc Szy
  • 3
  • 1
  • 2
    Please do _not_ paste screenshots in your questions. Paste the actual text messages. – DYZ Aug 21 '18 at 15:33
  • This question is surely a dupe. – DYZ Aug 21 '18 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. – PM 2Ring Aug 21 '18 at 15:39
  • Please see [Why may I not upload images of code on SO when asking a question?](http://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-on-so-when-asking-a-question) – PM 2Ring Aug 21 '18 at 15:39

1 Answers1

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.

Joe Iddon
  • 20,101
  • 7
  • 33
  • 54
  • I seriously don't know why it didn't work in the first place, but thank you very much! – Marc Szy Aug 21 '18 at 16:10
  • @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! – Joe Iddon Aug 21 '18 at 16:13