From ac280420ff71066fd5230e61cc4f243c9ecab3a3 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Thu, 18 Mar 2021 23:18:11 -0400 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Python=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E7=9A=84=E5=AE=9E=E9=99=85=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +++- tests/RandomStringGenerate.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 48c8c0d..766e236 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ GitHub 上有关 CWIKIUS 的项目:[https://github.com/cwiki-us-docs/cwikius-d | 网站名称 | URL | NOTE | |---|---|---| +| WWW.CWIKIUS.CN | [http://www.cwikius.cn/](http://www.cwikius.cn/) | CWIKIUS.CN 一个有独立思考和温度的清新站 | | [Python - 100天从新手到大师](https://github.com/jackfrued/Python-100-Days) | [https://github.com/jackfrued/Python-100-Days](https://github.com/jackfrued/Python-100-Days) | 我们参考了原作者的一些代码和测试用例。 | | [Python语言基础50课](https://github.com/jackfrued/Python-Core-50-Courses) | [https://github.com/jackfrued/Python-Core-50-Courses](https://github.com/jackfrued/Python-Core-50-Courses) | 参考了原作者的部分内容和编排目录 | -| WWW.CWIKIUS.CN | [http://www.cwikius.cn/](http://www.cwikius.cn/) | CWIKIUS.CN 一个有独立思考和温度的清新站 | +| [Python 脚本收集](https://github.com/fnplus/Python-scripts-collection) | [https://github.com/fnplus/Python-scripts-collection](https://github.com/fnplus/Python-scripts-collection) | 针对 Python 使用的一些实际脚本的收集 | + diff --git a/tests/RandomStringGenerate.py b/tests/RandomStringGenerate.py index f7b9c0a..fc6e23c 100644 --- a/tests/RandomStringGenerate.py +++ b/tests/RandomStringGenerate.py @@ -18,6 +18,7 @@ def random_password(length, printable): if __name__ == "__main__": + print(__name__) 3 amount = int(input("请输入需要生成随机字符串的数量: ")) From 59f60078cb7bb1c6bc00272c9f44c1188e8bfb92 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Thu, 18 Mar 2021 23:40:06 -0400 Subject: [PATCH 2/4] =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=AE=BE=E7=BD=AE=20IF?= =?UTF-8?q?=20=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 5 ++++- tests/RandomStringGenerate.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 53a6226..ed217ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,7 @@ yfinance==0.1.54 python-dateutil~=2.8.1 -setuptools~=54.0.0 \ No newline at end of file +setuptools~=54.0.0 +ruamel.yaml +qrcode +Pillow \ No newline at end of file diff --git a/tests/RandomStringGenerate.py b/tests/RandomStringGenerate.py index fc6e23c..6339550 100644 --- a/tests/RandomStringGenerate.py +++ b/tests/RandomStringGenerate.py @@ -18,8 +18,9 @@ def random_password(length, printable): if __name__ == "__main__": - print(__name__) 3 + print(__name__) + amount = int(input("请输入需要生成随机字符串的数量: ")) number = int(input("请输入随机字符串的长度: ")) From 3daaced0eeb4bdf7fa029506f8b2a011c269ccc5 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Thu, 18 Mar 2021 23:42:29 -0400 Subject: [PATCH 3/4] =?UTF-8?q?Python=20=E7=9A=84=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=8F=98=E9=87=8F=20=5F=5Fname=5F=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/VariableName/ImportVarName.py | 13 +++++++++++++ tests/VariableName/VarName.py | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/VariableName/ImportVarName.py create mode 100644 tests/VariableName/VarName.py diff --git a/tests/VariableName/ImportVarName.py b/tests/VariableName/ImportVarName.py new file mode 100644 index 0000000..7def4cd --- /dev/null +++ b/tests/VariableName/ImportVarName.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- + +# Python __name__ module ImportVarName +# Author - HoneyMoose(huyuchengus@gmail.com) +# Link Article - https://www.ossez.com/t/python-name/13393 + + +print("ImportVarName __name__ = %s" % __name__) + +if __name__ == "__main__": + print("ImportVarName is being run directly") +else: + print("ImportVarName is being imported") diff --git a/tests/VariableName/VarName.py b/tests/VariableName/VarName.py new file mode 100644 index 0000000..3a26128 --- /dev/null +++ b/tests/VariableName/VarName.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- + +# Python __name__ module Test +# Author - HoneyMoose(huyuchengus@gmail.com) +# Link Article - https://www.ossez.com/t/python-name/13393 + +import ImportVarName + +print("Main VarName __name__ = %s" % __name__) + +if __name__ == "__main__": + print("VarName is being run directly") +else: + print("VarName is being imported") From 5dbd9e8352bcbc49ae04cefca4146b4bda191460 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Thu, 18 Mar 2021 23:44:04 -0400 Subject: [PATCH 4/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BD=9C=E8=80=85?= =?UTF-8?q?=E5=88=B0=E6=B5=8B=E8=AF=95=E8=AF=B4=E6=98=8E=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/RandomStringGenerate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/RandomStringGenerate.py b/tests/RandomStringGenerate.py index 6339550..f7b9ac5 100644 --- a/tests/RandomStringGenerate.py +++ b/tests/RandomStringGenerate.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # Python Random String Password -# Author - https://www.ossez.com +# Author - HoneyMoose(huyuchengus@gmail.com) +# Link Article - https://www.ossez.com/c/open-source/python/14 import string from random import choice