摘要: 1.使用os模块 import os os.path.exists(test_file.txt) #True os.path.exists(no_exist_file.txt) #False 2.使用Try语句 # try: # f =open('1.txt','r',encoding='utf-8 阅读全文
posted @ 2020-09-29 16:28 一只小泡沫 阅读(293) 评论(0) 推荐(0) 编辑