摘要: 一、Python读写txt文件 1.1 python读取txt文件 in_text_file = "xxx.txt" with open(in_text_file) as f: lines = f.readlines() lines = [line.strip() for line in lines 阅读全文
posted @ 2022-09-03 15:22 达可奈特 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Python自带os.path库相关函数 一、判断文件/路径是否存在 os.path.isfile() os.path.isdir() os.path.exists() 可缩写为:import os.path as osp 返回值:True/False 二、创建文件夹 os.makedirs() i 阅读全文
posted @ 2022-09-03 15:18 达可奈特 阅读(17) 评论(0) 推荐(0) 编辑