11 2021 档案

摘要:解决办法: ssh-keygen -R 远程服务器IP 阅读全文
posted @ 2021-11-21 23:06 MoKin_Li 阅读(122) 评论(0) 推荐(0) 编辑
摘要:cp stands for copy. This command is used to copy files or group of files or directory. It creates an exact image of a file on a disk with different fi 阅读全文
posted @ 2021-11-08 16:06 MoKin_Li 阅读(94) 评论(0) 推荐(0) 编辑
摘要:命名规范推荐 Packages:lower_with_under Modules:lower_with_under Class:CapWords(UpperCamelCase) Exceptions:CapWords Functions:lower_with_under() Global/Class 阅读全文
posted @ 2021-11-08 15:43 MoKin_Li 阅读(1578) 评论(0) 推荐(0) 编辑
摘要:属性 (必须遵守)(规则): 3、公共属性的注释写在属性声明的上方,与声明保持同样的缩进; 行内注释应以#和一个空格作为开始,与后面的文字注释以一个空格隔开; 说明:行内注释的形式是在语句上一行中加注释;行内注释要少用,他们应以#和一个空格作为开始; 格式 (必须遵守)(规则): 4、模块文档字符串 阅读全文
posted @ 2021-11-08 14:53 MoKin_Li 阅读(713) 评论(0) 推荐(0) 编辑
摘要:注释和文档字符串的原则是:有助于对程序的阅读理解; python没有类型信息,IDE不能帮助提示,如果没有注释,动态语言就很难理解; 注释不宜太多也不能太少,一般建议建议有效注释量(包括文档字符串)应该在20%以上。 撰写好的注释有以下建议: 注释描述必须准确、易懂、简洁,不能有二义性; 避免在注释 阅读全文
posted @ 2021-11-08 11:59 MoKin_Li 阅读(835) 评论(0) 推荐(0) 编辑
摘要:导入: (必须遵守)(规则): 10、加载模块必须分开,每个模块占一行; 一行只能加载一个模块,但,同一个模块内,多个符号,可以在同一行加载; import 语句有一个变体,可以直接把模块里的名称导入到另一个模块的符号表: >>> from fibo import fib, fib2 >>> fib 阅读全文
posted @ 2021-11-08 11:52 MoKin_Li 阅读(228) 评论(0) 推荐(0) 编辑
摘要:排版相关: 缩进: (必须遵守)(规则): 1、程序块采用缩进风格编写,缩进的空格数为4个,是业界通用的标准; 2、禁止混用空格(SPACE)和跳格(TAB) 3、新项目必须使用纯空格(SPACE)来代替跳格(TAB) 语句: 4、Python文件必须使用UTF-8编码:Python文件必须使用UT 阅读全文
posted @ 2021-11-05 17:03 MoKin_Li 阅读(1248) 评论(0) 推荐(0) 编辑
摘要:1 ListA=[] 2 ListB=[1] 3 if not ListA: 4 print("List A Empty~") 5 if ListB: 6 print("List B NOT Empty~") 最后的回显为: 1 (PythonVirtualEnv_3100) PS D:\Pytho 阅读全文
posted @ 2021-11-05 15:57 MoKin_Li 阅读(111) 评论(0) 推荐(0) 编辑
摘要:类型比较的时候 要使用 isinstance(item, str) 不用 type(item) == str 区别在于: type()不会认为子类是一种父类类型; isinstance()会认为子类是一种父类类型; class FOO(): pass class BAR(FOO): pass pri 阅读全文
posted @ 2021-11-05 15:43 MoKin_Li 阅读(161) 评论(0) 推荐(0) 编辑
摘要:最近遇到的很蠢的问题; 虚拟环境激活后,没有办法取消激活了; (PythonVirtualEnv_3100) PS D:\PythonVirtualEnv\PythonVirtualEnv_3100\Scripts> ls 目录: D:\PythonVirtualEnv\PythonVirtualE 阅读全文
posted @ 2021-11-02 11:47 MoKin_Li 阅读(599) 评论(0) 推荐(0) 编辑
摘要:import sys #sys模块提供了一系列有关Python运行环境的变量和函数。 print(sys.version) #sys.version用来获取Python解释程序的版本信息 或 import platform #platform模块给我们提供了很多方法去获取操作系统的信息 print( 阅读全文
posted @ 2021-11-02 11:43 MoKin_Li 阅读(680) 评论(0) 推荐(0) 编辑
摘要:def foo(): print("***Starting***") while True: res = yield 4 print("res:",res) g=foo() print(next(g)) print(g.send(1)) print(next(g)) 最后的输出结果为: (Pytho 阅读全文
posted @ 2021-11-01 21:31 MoKin_Li 阅读(39) 评论(0) 推荐(0) 编辑
摘要:def foo(): print("***Starting***") while True: res = yield 4 print("res:",res) g=foo() print(g) 程序开始执行以后,因为foo函数中有yield关键字,所以foo函数并不会真的执行,而是先得到一个生成器g( 阅读全文
posted @ 2021-11-01 20:56 MoKin_Li 阅读(51) 评论(0) 推荐(0) 编辑
摘要:查看:cat /etc/*-release 阅读全文
posted @ 2021-11-01 20:46 MoKin_Li 阅读(24) 评论(0) 推荐(0) 编辑
摘要:class First_Name(): print("Cookies") class Last_Name(object): print("Lee") x=First_Name() y=Last_Name() print(dir(x)) print(dir(y)) 最后的输出结果为: (4Projec 阅读全文
posted @ 2021-11-01 17:50 MoKin_Li 阅读(520) 评论(0) 推荐(0) 编辑
摘要:Linux里查看所有用户 (1)root账户下,查看 /etc/passwd文件; (2)第三个参数:500以上为新建用户,其它为系统用户 或者用cat /etc/passwd |cut -f 1,3 -d: 阅读全文
posted @ 2021-11-01 11:43 MoKin_Li 阅读(2069) 评论(0) 推荐(0) 编辑