根据CDImage.cue产生自动改名命令的Python小程序
2005-09-13 10:02
393 查看
.comment {color:#009900}
.keyword {color:#0000FF; font-weight:bold}
.string {color:#999999}
.number {color:#FF0000}
.buildinfunctions {color:#FF0000}
.methods {color:#009999}
.attributes {color:#009999}
.exceptions {color:#FF0000}
.op {color:#993300}
.commonlibs {color:#660066}
.userdefine {color:#0000FF}
.keyword {color:#0000FF; font-weight:bold}
.string {color:#999999}
.number {color:#FF0000}
.buildinfunctions {color:#FF0000}
.methods {color:#009999}
.attributes {color:#009999}
.exceptions {color:#FF0000}
.op {color:#993300}
.commonlibs {color:#660066}
.userdefine {color:#0000FF}
#!/usr/bin/python # -*- coding: cp936 -*- ################################# # Written by caocao # # caocao@eastday.com # # http://nethermit.yeah.net # ################################# import sys import re import string print "Written by caocao" print "caocao@eastday.com" print "http://nethermit.yeah.net" print if len(sys.argv)!=2: print "Usage: python ren.ape.py filepath" sys.exit(1) try: fp=open(sys.argv[1]) except IOError: print "Can't load file from "+sys.argv[1]+"\nPlease make sure this file exists." sys.exit(1) contentList=fp.readlines() fp.close() i=1 for contentLine in contentList: matchObject=re.search("^ +TITLE *\"(.+)\"$", contentLine, re.I) if matchObject!=None: if i<10: rowNum="0%d" % i else: rowNum="%d" % i i+=1 print "ren "+rowNum+".ape "+rowNum+"."+string.replace(matchObject.group(1), " ", ".")+".ape "
相关文章推荐
- 根据CDImage.cue产生自动改名命令的Python小程序
- PDF自动改名的Python程序
- 第一个Python程序——博客自动访问脚本
- python不是内部或外部命令,也不是可运行的程序或批处理文件
- Editplus借助python实现根据方法参数自动生成php注释
- 根据输入显示一个人的出生日期(我的第二个python程序)
- 为Python添加交互模式下TAB自动补全以及命令历史功能
- python dba 不是内部或外部命令 也不是可运行程序
- 百度音乐新歌榜100曲自动下载,并改名,python2.7
- Python+selenium创建自动执行命令脚本
- Python添加tab自动补全及命令历史功能。
- python+soket实现 TCP 协议的客户/服务端中文(自动回复)聊天程序
- python实现的ftp自动上传下载程序(支持目录递归操作)----转
- Python 命令自动补全
- Python命令tab键自动补全
- python 实现自动上传文件到百度网盘(附程序源码及实现过程)
- python实现自动重启本程序的方法
- Python实现Tab自动补全和历史命令管理的方法
- rabbitmq的安装和命令介绍及python程序模拟生产者和消费者
- 批处理程序:自动登陆服务端,并循环执行某些命令