Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python存档 #43

Open
yihong0618 opened this issue Sep 30, 2019 · 10 comments
Open

Python存档 #43

yihong0618 opened this issue Sep 30, 2019 · 10 comments
Labels
技术文章 技术文章

Comments

@yihong0618
Copy link
Owner

竟然才加上Python--2019.9.30

  1. lstrip
  2. partition 返回元祖(3个成员)
@yihong0618 yihong0618 added the 技术文章 技术文章 label Sep 30, 2019
@yihong0618
Copy link
Owner Author

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

with open("abaaa.txt", "w+") as f:
    f.write("aaaaaaaaaaaaaaa")
@yihong0618
Copy link
Owner Author

django celery && celery 启动命令

python manage.py celery -A matrix_bgp worker --settings=
python manage.py celery beat --settings=
@yihong0618
Copy link
Owner Author

>>>str = 'runoob'
>>> str.center(20, '*')
'*******runoob*******'
>>> str.center(20)
'       runoob       '
@yihong0618
Copy link
Owner Author

pip version
19.2.3

@yihong0618
Copy link
Owner Author

@yihong0618
Copy link
Owner Author

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

@yihong0618
Copy link
Owner Author

nametuple尽量小写否则有坑。

@yihong0618
Copy link
Owner Author

python 打包上传pypi

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

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

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

@yihong0618 yihong0618 removed the kb kb label Nov 26, 2020
@yihong0618
Copy link
Owner Author

python -c "import site; print(site.getsitepackages())"

@longqzh
Copy link

longqzh commented Jul 23, 2022

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
技术文章 技术文章
2 participants