运行一旦报错就直接退出,比如下图这里
try except 捕获一下异常
try: //业务代码 except Exception: pass
用if os.path.isdir(file_path):判断下选择的文件夹是不是存在