Set the current directory when running a SimpleHTTPServer

If you’re using SimpleHTTPServer directly from command line, you can simply use shell features:

pushd /path/you/want/to/serve; python -m SimpleHTTPServer; popd

In Python 3 you have to use:

pushd /path/you/want/to/serve; python -m http.server; popd

The SimpleHTTPServer module has been merged into http.server in Python 3.0

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)