一,1S启动一个下载服务器
xhn@xu-pc:~$ ls
examples.desktop test1.txt 公共的 模板 视频 图片 文档 下载 音乐 桌面
python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
打开浏览器,输入IP加端口
xhn@xu-pc:~$ python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
192.168.155.3 - - [07/Apr/2018 16:58:10] "GET / HTTP/1.1" 200 -
192.168.155.3 - - [07/Apr/2018 16:58:10] code 404, message File not found
192.168.155.3 - - [07/Apr/2018 16:58:10] "GET /favicon.ico HTTP/1.1" 404 -
192.168.155.3 - - [07/Apr/2018 16:58:19] "GET /test1.txt HTTP/1.1" 200 -
192.168.155.3 - - [07/Apr/2018 16:58:31] "GET /%E4%B8%8B%E8%BD%BD/ HTTP/1.1" 200 -
192.168.155.3 - - [07/Apr/2018 16:58:34] "GET /%E4%B8%8B%E8%BD%BD/Python%20Linux%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E4%B8%8E%E8%87%AA%E5%8A%A8%E5%8C%96%E8%BF%90%E7%BB%B4.pdf HTTP/1.1" 200 -
用于文件的共享,快捷方便
重点内容
二,字符串 转换为json
echo '{"name": "lucy", "age": "18"}'| python -m json.tool
三,检查第三方库是否安装
python
import re
#若安装成功,则无返回,失败则返回错误信息