joxin

诚信、业绩、创新

导航

python学习笔记之五

Posted on 2018-11-01 08:18    阅读(140)  评论(0编辑  收藏  举报

1、Python HTTP server

win环境需要加cgi参数
python -m http.server --cgi 8000
其他如下:
python -m http.server 8080
2、指定位数不足补零
zfill方法:
n = "123"
s = n.zfill(5)
assert s == "00123"
字符串格式化方法:
n = 123
s = "%05d" % n
assert s == "00123"
 
3、python与c++混合编程
pybind11