Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1778550
  • 博文数量: 276
  • 博客积分: 1574
  • 博客等级: 上尉
  • 技术积分: 2894
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-26 23:23
个人简介

生活的美妙在于,不知道一下秒是惊艳还是伤神,时光流转,珍惜现在的拥有的时光

文章分类

全部博文(276)

文章存档

2017年(17)

2016年(131)

2015年(63)

2013年(2)

2012年(32)

2011年(31)

分类: Python/Ruby

2016-01-28 20:05:48

判断是否
>>> import os
>>> os.path.isfile('/opt/dir')
False
>>> os.path.isfile('/opt/file')
True
>>> os.path.exists('/opt/file')
True
>>> os.path.exists('/opt/dir')
True
>>> os.makedirs('/opt/dir1')
>>> os.path.exists('/opt/dir1')
True
阅读(2504) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~