摘要: 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 阅读(51) 评论(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 阅读(58) 评论(0) 推荐(0)
摘要: 查看:cat /etc/*-release 阅读全文
posted @ 2021-11-01 20:46 MoKin_Li 阅读(33) 评论(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 阅读(534) 评论(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 阅读(2094) 评论(0) 推荐(0)