Tag
一、用os模块判断文件夹是不是存在 Python的os模块给了丰有钱的文件和目录操作功能。要判断一个文件夹是不是存在能用os.path.exists方法。 import os dir_path = "/path/to/dir" if os.path.exists: print else: print 二、 用try语句判断文件夹是不是存在 除了用os模块的方法
查看更多 2025-08-12
Demand feedback
售前技术支持