python - 127.0.0.1 拒绝连接

标签 python html d3.js terminal macros

在命令提示符下我输入

python -m HTTPServer

我得到了

Serving HTTP on 0.0.0.0 port 8000

但是当我尝试访问本地主机页面时,它无法打开。

我也尝试过

http://127.0.0.1:8000/ 

但仍然没有任何进展。

输出:

output

此外,我的电脑安装了 anaconda,我认为它可能会阻碍 8000 端口。我不想卸载 anaconda。当我尝试学习 D3 时,如何使用此端口或另一个新端口?

enter image description here

最佳答案

使用 python3,在您的 Web Assets 目录中运行以下命令:

python -m http.server 8000

这应该相当于在 python2 中使用 SimpleHTTPServer。

关于python - 127.0.0.1 拒绝连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51809248/

相关文章:

python - 在python中获取 float 的小数部分

javascript - 如何解析D3中的数字类型日期

d3.js - 使圆环图可点击

python - 在一个键列上加入两个数据帧/错误 : 'columns overlap but no suffix specified'

python - 如何显示每个Y轴的图表类型以区分比较因素

python - 为什么 Python 元组中的空格很重要?

jQuery 图像在 div 中显示不正确

javascript - 制作蓝色乐谱动画条

python - 如何从python 3中的url读取html

javascript - D3和弦图,带确切位置