`
kanpiaoxue
  • 浏览: 1744959 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

python SimpleHTTPServer和SimpleXMLRPCServer

 
阅读更多

 

python有2个非常有用的内置服务器:

SimpleHTTPServer和SimpleXMLRPCServer

 

指定端口:

python -m SimpleHTTPServer 8000

 

在python3中上面的命令行是不能用,因为SimpleHTTPServer 在python3中被移动到了 http.server 中。因此python3的调用方式如下:

python3 -m http.server 8000

 

 

官方文档: https://docs.python.org/2/library/simplehttpserver.html

 

Note

 

The SimpleHTTPServer module has been merged into http.server in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.

Warning

 

SimpleHTTPServer is not recommended for production. It only implements basic security checks.

 

 

《Serving Files with Python's SimpleHTTPServer Module》:https://stackabuse.com/serving-files-with-pythons-simplehttpserver-module/

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics