from os.path import exists print(f"Does the output file exist? {exists(to_file)}")
exists:
将文件名字符串作为参数,如果文件存在返回True;否则False