Skip to content
yihong0618's Blog
Go back

Python存档

Updated:

Originally published as GitHub issue #43.

竟然才加上Python—2019.9.30

  1. lstrip
  2. partition 返回元祖(3个成员)

Comments

yihong0618

View comment · 2019-12-19T05:26:27Z

Python 打开一个不存在的文件往里写用

with open("abaaa.txt", "w+") as f:
    f.write("aaaaaaaaaaaaaaa")

yihong0618

View comment · 2019-12-26T03:25:21Z

django celery && celery 启动命令

python manage.py celery -A matrix_bgp worker --settings=
python manage.py celery beat --settings=

yihong0618

View comment · 2019-12-27T03:46:07Z

>>>str = 'runoob'
>>> str.center(20, '*')
'*******runoob*******'
>>> str.center(20)
'       runoob       '

yihong0618

View comment · 2020-05-13T05:29:16Z

pip version 19.2.3

yihong0618

View comment · 2020-05-29T05:51:09Z

字符串报错 https://www.cnblogs.com/lsdb/p/12470739.html

yihong0618

View comment · 2020-05-29T05:52:10Z

如何发布一个package到PyPI https://haofly.net/how-to-publish-python-package-md/

yihong0618

View comment · 2020-09-20T06:55:29Z

nametuple尽量小写否则有坑。

yihong0618

View comment · 2020-09-28T07:06:49Z

python 打包上传pypi

首先安装上传工具 pip3 install -U pip setuptools twine

打包 python3 setup.py sdist # 会将项目打包到当前目录下面并生成相应的egg

上传 twine upload dist/* # 其实就是上传的dist目录下的zip包

yihong0618

View comment · 2021-04-16T07:20:34Z

python -c “import site; print(site.getsitepackages())”

longqzh

View comment · 2022-07-23T01:23:30Z

>>>str = 'runoob'
>>> str.center(20, '*')
'*******runoob*******'
>>> str.center(20)
'       runoob       '

变量名不要覆盖内置类嘛~ 呵呵



Previous Post
一点思考
Next Post
今天的跑步电台