python3 http server command line


How to serve static files with python3

In this short tutorial, we explain how to start a very small http server that can be useful to share files across the network. Don't use this for production!

Open your favorite terminal and execute:

python -m http.server 8000 if(typeof __ez_fad_position != 'undefined'){__ez_fad_position('div-gpt-ad-tutorials_technology-medrectangle-3-0')};if(typeof __ez_fad_position != 'undefined'){__ez_fad_position('div-gpt-ad-tutorials_technology-medrectangle-3-0_1')}; .medrectangle-3-multi-114{border:none !important;display:block !important;float:none;line-height:0px;margin-bottom:2px !important;margin-left:0px !important;margin-right:0px !important;margin-top:2px !important;min-height:250px;min-width:250px;text-align:center !important;} The previous command will start a http server on port 8000 on the directory that you executed the command. Just open with the browser on http://localhost:8000 (or your network ip address).