import

from os.path import exists

print(f"Does the output file exist? {exists(to_file)}")

exists:

将文件名字符串作为参数,如果文件存在返回True;否则False

posted @ 2022-09-22 17:41  瑟庄妮  阅读(55)  评论(0)    收藏  举报