Open ysh329 opened 4 years ago
使用Python SimpleHTTPServer 快速启动http服务 当前Python版本为2.7,3.5以后的版本略有区别,可用$ python --version 查看Python版本
1、进入需要分享的目录
cd ~
2、开启http服务
# 当前运行 不填写端口 默认8000 python -m SimpleHTTPServer 8888 # 当前终端后台运行 python -m SimpleHTTPServer 8888 & # 完全后台运行 nohup python -m SimpleHTTPServer 8888 &
后台日志:
前端显示:
注意事项 SimpleHTTPServer有一个特性,如果待共享的目录下有index.html,那么index.html文件会被视为默认主页;如果不存在index.html文件,那么就会显示整个目录列表。 在哪个目录下启动,就会以当前目录为根目录展示列表
使用Python SimpleHTTPServer 快速启动http服务 当前Python版本为2.7,3.5以后的版本略有区别,可用$ python --version 查看Python版本
1、进入需要分享的目录
cd ~
2、开启http服务
后台日志:![image](https://user-images.githubusercontent.com/7320657/70903282-87b17480-2039-11ea-9c77-46a42a281977.png)
前端显示:
![image](https://user-images.githubusercontent.com/7320657/70903346-add71480-2039-11ea-817b-1da52bdb446e.png)
注意事项 SimpleHTTPServer有一个特性,如果待共享的目录下有index.html,那么index.html文件会被视为默认主页;如果不存在index.html文件,那么就会显示整个目录列表。 在哪个目录下启动,就会以当前目录为根目录展示列表