摘要: iter() __iter__ next() __next__ 感觉就是简化命令而已.,,,将10行的代码,简化后,用2个命令解决,产生了一个新的函数 这个有用 判断 ,将10行的代码,简化后,用2个命令解决,产生了一个新的函数(方法) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]< 阅读全文
posted @ 2019-09-23 22:54 大仙秋 阅读(177) 评论(0) 推荐(0) 编辑
摘要: print(data.decode('utf-8')) 转换utf-8格式f.write('杨件'.encode('utf-8')) 转换为bytes# f.write(bytes('1111\n',encoding='utf-8')) 转换为bytesf=open('b.txt','r+',enc 阅读全文
posted @ 2019-09-23 21:21 大仙秋 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 参考 https://www.cnblogs.com/linhaifeng/articles/5984922.html f=open('陈粒1',encoding='utf-8') open data=f.read() read print(data)f.close() close readable 阅读全文
posted @ 2019-09-23 02:49 大仙秋 阅读(128) 评论(0) 推荐(0) 编辑
摘要: zip print(list(zip(('a','n','c','d'),(1,2,3)))) [('a', 1), ('n', 2), ('c', 3)] 一一对应 元组变列表 keys() 取字典key values() 取字典value print(ord('a')) 字符转ASCII pri 阅读全文
posted @ 2019-09-23 01:53 大仙秋 阅读(128) 评论(0) 推荐(0) 编辑