First we need to install Python 3.x, if using Linux please refer to [Build Python Environment in Linux]. If using Windows, you can download from official straightly: https://www.python.org/downloads/windows/, The .zip file is portable version, other versions need installation.
（Windows Users）Go to the folder to share, right click with
Open Powershell in this folder or
Open command line in this folder.
python3 -m http.server （
python3 might be replaced by
py）, it uses port 8000 for default.
In order to use a specific port, type
python3 -m http.server <PORT>. To designate the folder, type
python3 -m http.server -d <FOLDER NAME>.
There is some more things to do with Portable version, you have to type the full path of Python executable program instead of the abbreviations like
To make a .py script, create a new file and type content below,
import http.server import socketserver PORT = 8000 # Port Handler = http.server.SimpleHTTPRequestHandler with socketserver.TCPServer(("", PORT), Handler) as httpd: print("serving at port", PORT) httpd.serve_forever()