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

查看:534
本文介绍了在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:\Python33\python.exe: No module named SimpleHTTPServer

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

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

推荐答案

来自堆栈溢出问题

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

以下对我有用:

python -m http.server [<portNo>]

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

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天全站免登陆