1

Running a basic Python SimpleHTTPServer to check out some files in browser. Once the SimpleHTTPServer is running in one directory how do you stop it and use a different directory? or just have it switch to the new one.

Currently using in terminal:

python -m SimpleHTTPServer 8008

Then if I try to run on another directory it says it's already in use. So basically how to I stop a given instance of SimpleHTTPServer?

1 Answer 1

2

Then if I try to run on another directory it says it's already in use

You can only bind to each port once with SimpleHTTPServer. If you are already running the server on port 8008, you can not run another instance listening on that same port.

you should stop the server, and launch it from the other directory... or choose a different port number for running the 2nd instance.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.