在 Windows 上设置 Python simpleHTTPserver [英] Set up Python simpleHTTPserver on Windows

查看:60
本文介绍了在 Windows 上设置 Python simpleHTTPserver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Windows XP 上设置 Python SimpleHTTPServer.我的电脑上安装了 Python.我正在执行以下命令:

I want to set up Python SimpleHTTPServer on Windows XP. I have Python installed on my computer. I am executing the following command:

python -m SimpleHTTPServer 8888

但我收到错误:

C:Python33python.exe: No module named SimpleHTTPServer

适用于 Python 的 SimpleHTTPServer 是否在 Windows 上可用?如果是,我该如何设置服务器?

Is SimpleHTTPServer for Python available on Windows? If yes, what do I do to set up the server?

推荐答案

来自 Stack Overflow 的问题 Python 3 中python -m SimpleHTTPServer"的等价物是什么:

From Stack Overflow question What is the Python 3 equivalent of "python -m SimpleHTTPServer":

以下对我有用:

python -m http.server [<portNo>]

因为我使用的是 Python 3 模块 SimpleHTTPServer 已被 http.server 替换,至少在 Windows 中是这样.

Because I am using Python 3 the module SimpleHTTPServer has been replaced by http.server, at least in Windows.

这篇关于在 Windows 上设置 Python simpleHTTPserver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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