博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2021年2月12日

摘要: 判断目录是否存在,若不存在,则创建 import os dirs = '/Users/joseph/work/python/' if not os.path.exists(dirs): os.makedirs(dirs) 判断文件是否存在,若不存在,则创建 import os filename = 阅读全文

posted @ 2021-02-12 18:44 小翁好 阅读(613) 评论(0) 推荐(0)