批量生成ETL Automation APP下Perl脚本执行目录,etlperl,批量生成ETL Auto
批量生成ETL Automation APP下Perl脚本执行目录,etlperl,批量生成ETL Auto
批量生成ETL Automation调用Perl脚本时所需的目录结构与控制文件
import osimport sysimport shutilimport time# Perl脚本所在目录,由shell参数的形式传入path = sys.argv[1]# 控制文件名control = "control.pl"# 遍历path目录下的所有文件并创建与文件名对应的目录def ls(path): dirs = os.listdir(path) for title in dirs: if (os.path.isdir(os.path.join(path,title))) or (title.find(control) != -1): continue else: dirname = title[:-7].upper() binname = dirname + os.sep + "bin" controlfile = binname + os.sep + title[:-7] + "_0400.pl" os.mkdir(os.path.join(path,dirname)) os.mkdir(os.path.join(path,binname)) shutil.copy2(os.path.join(path,title),os.path.join(path,binname)) shutil.copy2(os.path.join(path,control),os.path.join(path,controlfile))# 批量删除path下的文件,并备份到指定目录def remove(path): dirs = os.listdir(path) today = path + os.sep + time.strftime("%Y%m%d") if not os.path.exists(today): os.mkdir(today) for title in dirs: abspath = os.path.join(path,title) if os.path.isdir(abspath): continue else: shutil.copy2(abspath,os.path.join(path,today)) os.remove(abspath)ls(path)remove(path)#该片段来自于http://byrx.net
相关内容
- 使用PIL给图片加水印的工具类,pil工具类,#! /usr/bin/
- Python读取Excel的方法封装,python读取excel,今天需要从一
- PyQt4 精彩实例分析_电子钟改进版,pyqt4改进版,此代码根
- blender插件DEMO,添加一个三菱锥,blender三菱,这个blend
- 生成Chaos风格的PhotoMosaic效果,chaosphotomosaic,platform: li
- 绘制人人好友关系图,绘制人人好友,依赖:networkx
- mysql数据导入到sqlite3中,数据导入sqlite3,家里的路由器
- 获取电影最新下载列表,获取电影最新下载,# coding=gb
- 打开文件对话框,,from tkinter
- Session for Tornado(Redis),tornadoredis,session id的生
评论关闭