与Python 3等价的"python -m SimpleHTTPServer"是什么? [英] What is the Python 3 equivalent of "python -m SimpleHTTPServer"

查看:156
本文介绍了与Python 3等价的"python -m SimpleHTTPServer"是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

相当于python -m SimpleHTTPServer的Python 3是什么?

What is the Python 3 equivalent of python -m SimpleHTTPServer?

推荐答案

来自文档:

SimpleHTTPServer模块已在Python 3.0中合并到http.server中.将源转换为3.0时,2to3工具将自动适应导入.

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.

因此,您的命令是python -m http.server,或者取决于您的安装,它可以是:

So, your command is python -m http.server, or depending on your installation, it can be:

python3 -m http.server

这篇关于与Python 3等价的"python -m SimpleHTTPServer"是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆