2024-03-29 14:43:56 发布
网友
Python 3相当于python -m SimpleHTTPServer的是什么?
python -m SimpleHTTPServer
相当于:
python3 -m http.server
使用2to3实用程序。
$ cat try.py import SimpleHTTPServer $ 2to3 try.py RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: set_literal RefactoringTool: Skipping implicit fixer: ws_comma RefactoringTool: Refactored try.py --- try.py (original) +++ try.py (refactored) @@ -1 +1 @@ -import SimpleHTTPServer +import http.server RefactoringTool: Files that need to be modified: RefactoringTool: try.py
来自the docs:
The SimpleHTTPServer module has been merged into http.server in Python 3.0. The 2to3 tool will automatically adapt imports when converting your sources to 3.0.
SimpleHTTPServer
http.server
因此,您的命令是python -m http.server,或者根据您的安装,它可以是:
python -m http.server
相当于:
使用2to3实用程序。
来自the docs:
因此,您的命令是
python -m http.server
,或者根据您的安装,它可以是:相关问题 更多 >
编程相关推荐