Using Python to quickly build a local directory as a Http server
- Quick way to open CMD command in any folder in Windows system:
Method 1:
Press shift in the margin of the folder and right-click the mouse button.
Select 'Open Command Window Here'.
Win10: Select 'powershell',can also enter "start cmd"
Method 2:
Enter CMD to return in the path box on this folder
- Steps:
1.Install python, add installation directory to system environment variable PATH
2.Get the local IP address through the'ipconfig'command
3.Open CMD command in the HttpServer folder
4.Run the following command
python -m http.server 8010
# python 3.0
python -m SimpleHTTPServer 8010
# python 2.0
--> Serving HTTP on 0.0.0.0 port 8010 ...
5.Usage:
local:
http://localhost:8010/
webs:
http://192.168.8.112:8010/
# '192.168.8.112' is your IP,
# '8010':Customizable port number