1. 首页
  2. 数据库
  3. 其它
  4. python目录与文件名操作例子

python目录与文件名操作例子

上传者: 2020-12-31 00:35:45上传 PDF文件 23.86KB 热度 10次
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
下载地址
用户评论