سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top