import os def check_file_exist(file): if not os.path.isfile(file): raise FileNotFoundError("文件不存在:%s" % file)