欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

python檢查指定文件是否存在的方法

 更新時(shí)間:2015年07月06日 14:49:08   作者:pythoner  
這篇文章主要介紹了python檢查指定文件是否存在的方法,涉及Python基于os模塊判定文件的相關(guān)技巧,非常簡(jiǎn)單實(shí)用,需要的朋友可以參考下

本文實(shí)例講述了python檢查指定文件是否存在的方法。分享給大家供大家參考。具體如下:

import os
def file_exists(file_name): 
  if os.path.exists(file):
    return '%s is found' % file_name
  else: 
    return '%s is missing' % file_name

希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論