StupidBeauty
Read times:540Posted at:Fri Nov 23 22:05:04 2012
- no title specified

转载 如何判断文件或目录是否存在(python)

要判断一个文件是否存在,可使用os.path.isfile()。

http://www.360doc.com/content/11/0416/18/2660674_110110352.shtml

亮点:

import os
os.path.isfile('a.txt') #如果不存在就返回False

Your opinions
Your name:Email:Website url:Opinion content: