摘要: 1. 检查网络是否工作 ping www.baidu.com 2. 手动配置网卡的配置文件 (1) cd /etc/sysconfig/network-scripts/ (2) ll ifcfg* (3) 编辑 网卡的配置文件,设置ONBOOT的值为’yes‘,例如 vi ifcfg-enp0s3. 阅读全文
posted @ 2022-01-02 10:53 Ruby-Liu 阅读(44) 评论(0) 推荐(0)
摘要: L E G B nonlocal global 阅读全文
posted @ 2021-12-23 16:10 Ruby-Liu 阅读(23) 评论(0) 推荐(0)
摘要: 必备参数 关键字参数 默认参数 不定长参数 *args , **kwargs def print_info(name, age, sex="Male"): print("Name={}, Age={}, Sex={}".format(name, age, sex))print_info('Ruby' 阅读全文
posted @ 2021-12-23 14:30 Ruby-Liu 阅读(26) 评论(0) 推荐(0)
摘要: 1. 创建 {}, 类似于字典。 去重 2. 增删改元素 add(), remove()/pop()/clear(), update() 3. 关系运算 intersection() & union() | difference() - symmetic_diference() ^ issupers 阅读全文
posted @ 2021-12-16 14:18 Ruby-Liu 阅读(30) 评论(0) 推荐(0)
摘要: 获得文件句柄 f = open('','r+') 操作文件 readline(), readlines(), write(), flush(), truncate() 文件关闭 close() 文件操作模式 注意: for i in f: 和 f i in f.readlines()区别是: 后者是 阅读全文
posted @ 2021-12-15 14:21 Ruby-Liu 阅读(12) 评论(0) 推荐(0)
摘要: 无序 键唯一 注意:创建dict的第一种方法: {}直接赋值创建dict的第二种方法: dict()函数, 例如 dict((('Name','Ruby'),))创建dict 的第三种方法: dict.fromkeys ,浅拷贝 阅读全文
posted @ 2021-12-14 14:48 Ruby-Liu 阅读(9) 评论(0) 推荐(0)