Python内置了一个简单的HTTP服务器,命令行切换到放置网页文件(例如index.html)的目录,只需要在命令行下面敲一行命令,一个HTTP服务器就起来了:
1)Python2.x :
python -m SimpleHTTPServer 8080
2)Python3.x
python -m http.server 8080
试试:
http://localhost:8080
或者
http://127.0.0.1:8080
来访问你的index.html文件吧...
Python内置了一个简单的HTTP服务器,命令行切换到放置网页文件(例如index.html)的目录,只需要在命令行下面敲一行命令,一个HTTP服务器就起来了:
1)Python2.x :
python -m SimpleHTTPServer 8080
2)Python3.x
python -m http.server 8080
试试:
http://localhost:8080
或者
http://127.0.0.1:8080
来访问你的index.html文件吧...
转载于:https://my.oschina.net/u/2396236/blog/1525820