python目录与文件名操作例子

上传:harrypoter 浏览: 7 推荐: 0 文件:PDF 大小:23.86KB 上传时间:2020-12-31 00:35:45 版权申诉
1、操作目录与文件名 #!/usr/bin/env python #-*- coding: utf-8 -*- import os,re import shutil import time 用listdir搜索 def search_OFD_old(my_pattern, diretory): try: names = os.listdir(diretory) except os.error: print "error" return for name in names: fullname = os.path.normpath(os.path.j
上传资源
用户评论