手机
当前位置:查字典教程网 >脚本专栏 >python >python在指定目录下查找gif文件的方法
python在指定目录下查找gif文件的方法
摘要:本文实例讲述了python在指定目录下查找gif文件的方法。分享给大家供大家参考。具体实现方法如下:#!/usr/bin/python#Us...

本文实例讲述了python在指定目录下查找gif文件的方法。分享给大家供大家参考。具体实现方法如下:

#!/usr/bin/python # Use the standard find method to look for GIF files. import sys, find if len(sys.argv) > 1: dirs = sys.argv[1:] else: dirs = [ '.' ] # Go for it. for dir in dirs: files = find.find('*.gif', dir) if files: print "For", dir + ':' for fn in files: print " ", fn else: print "For", dir + ': None'

希望本文所述对大家的Python程序设计有所帮助。

【python在指定目录下查找gif文件的方法】相关文章:

python 实现归并排序算法

python sqlobject(mysql)中文乱码解决方法

python读取注册表中值的方法

Python 字符串操作方法大全

下载给定网页上图片的方法

Python 开发Activex组件方法

python中stdout输出不缓存的设置方法

python解析json实例方法

在python的WEB框架Flask中使用多个配置文件的解决方法

python操作MySQL数据库的方法分享

精品推荐
分类导航