Emka
Emka

Reputation: 350

Set up server with Python

I want to check a javascript project, that requires access to files with google chrome. I tried to add:

--allow-file-access-from-files --disable-web-security

to the browser but because of multiple instances of chrome I could not get result.

Now I am trying to set a server with Python, so I won't have to access files. I installed Python 3.3.2 and set the directory path to my project file location. The code is:

python -m http.server

But I am getting

File "(stdin)", line 1

python -m http.server

          ^

SyndaxError: invalid syntax

I know that my problem is not problem for mozilla but I need to get it working with Chrome.

Upvotes: 0

Views: 576

Answers (1)

falsetru
falsetru

Reputation: 369424

You should run the following command in shell (or cmd.exe). This is not python code.

python -m http.server

Upvotes: 2

Related Questions