摘要: 利用python把txt文件里数据的分号;改成空格 import os source_path = './txt' target_path = './result' if not os.path.exists(target_path): os.mkdir(target_path) file_list 阅读全文
posted @ 2020-05-31 13:18 这不是粥 阅读(1319) 评论(0) 推荐(0) 编辑
摘要: 列表推导式 我们经常需要这样处理一个列表:把一个列表里面的每个元素, 经过相同的处理 ,生成另一个列表。 当然可以用for循环处理,像这样 list1 = [1,2,3,4,5,6] list2 = [] for num in list1: list2.append(num*num) Python还 阅读全文
posted @ 2020-05-31 13:13 这不是粥 阅读(209) 评论(0) 推荐(0) 编辑