Python存档
yihong0618 opened this issue · 10 comments
yihong0618 commented
竟然才加上Python--2019.9.30
- lstrip
- partition 返回元祖(3个成员)
yihong0618 commented
Python 打开一个不存在的文件往里写用
with open("abaaa.txt", "w+") as f:
f.write("aaaaaaaaaaaaaaa")
yihong0618 commented
django celery && celery 启动命令
python manage.py celery -A matrix_bgp worker --settings=
python manage.py celery beat --settings=
yihong0618 commented
>>>str = 'runoob'
>>> str.center(20, '*')
'*******runoob*******'
>>> str.center(20)
' runoob '
yihong0618 commented
pip version
19.2.3
yihong0618 commented
yihong0618 commented
如何发布一个package到PyPI
https://haofly.net/how-to-publish-python-package-md/
yihong0618 commented
nametuple尽量小写否则有坑。
yihong0618 commented
python 打包上传pypi
首先安装上传工具
pip3 install -U pip setuptools twine
打包
python3 setup.py sdist # 会将项目打包到当前目录下面并生成相应的egg
上传
twine upload dist/* # 其实就是上传的dist目录下的zip包
yihong0618 commented
python -c "import site; print(site.getsitepackages())"
longqzh commented
>>>str = 'runoob' >>> str.center(20, '*') '*******runoob*******' >>> str.center(20) ' runoob '
变量名不要覆盖内置类嘛~ 呵呵