11 2019 档案

摘要:删除空目录 删除目录及其子目录和内容 阅读全文
posted @ 2019-11-04 22:56 魔阳工 阅读(128) 评论(0) 推荐(0)
摘要:import os import sys path = sys.argv[1] file = sys.argv[2] if not os.path.exists(path): os.makedirs(path) print("目录创建成功") else: print("该目录已经存在") os.chdir(path) print(os.getcwd()) newfil... 阅读全文
posted @ 2019-11-04 22:35 魔阳工 阅读(410) 评论(0) 推荐(0)
摘要:利用for循环按行读取文件 import sys input_file = sys.argv[1] fileread = open(input_file, 'r', encoding='UTF-8') line_number = 0 for a in fileread: line_number += 阅读全文
posted @ 2019-11-03 20:01 魔阳工 阅读(133) 评论(0) 推荐(0)