Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/320.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何获得;python http.server“;在ArchLinux中工作_Python_Linux_Python 3.x_Archlinux - Fatal编程技术网

如何获得;python http.server“;在ArchLinux中工作

如何获得;python http.server“;在ArchLinux中工作,python,linux,python-3.x,archlinux,Python,Linux,Python 3.x,Archlinux,当我输入“python http.server”时,我希望得到一个简单的web服务器,而不是: $ python http.server python: can't open file 'http.server': [Errno 2] No such file or directory 在我的服务器上,还有一个Arch-box(已经运行了一段时间,所以不清楚安装了什么软件包),这个命令确实运行Web服务器 我错过了什么 编辑:是的,当然是“-m”,我很抱歉浪费时间,但是谢谢你的帮助。对于Pyt

当我输入“python http.server”时,我希望得到一个简单的web服务器,而不是:

$ python http.server
python: can't open file 'http.server': [Errno 2] No such file or directory
在我的服务器上,还有一个Arch-box(已经运行了一段时间,所以不清楚安装了什么软件包),这个命令确实运行Web服务器

我错过了什么


编辑:是的,当然是“-m”,我很抱歉浪费时间,但是谢谢你的帮助。

对于Python2,我相信你要找的命令是

 python -m SimpleHTTPServer
如果你有蟒蛇3,那么建议你需要

 python3 -m http.server

对于Python2,我相信您正在寻找的命令是

 python -m SimpleHTTPServer
如果你有蟒蛇3,那么建议你需要

 python3 -m http.server

在Python3上,这将在端口
9000
上运行侦听服务器

$  python3 -m http.server 9000

在Python3上,这将在端口
9000
上运行侦听服务器

$  python3 -m http.server 9000