手机
当前位置:查字典教程网 >脚本专栏 >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删除java文件头上版权信息的方法

python 从远程服务器下载日志文件的程序

Python下singleton模式的实现方法

python 查找文件夹下所有文件 实现代码

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

python生成器的使用方法

Python中使用动态变量名的方法

python 获取本机ip地址的两个方法

python paramiko实现ssh远程访问的方法

精品推荐
分类导航