#
import sys,re
if __name__=="__main__":
rc = sys.argv[1]
ver = sys.argv[2]
ver = ver.replace('.', ',')
ver1 = ver.replace(',' , ', ')
rc = rc.replace("\\\\","\\")
f = open(rc,'r')
lines = f.readlines()
olines = []
for l in lines:
if l.startswith(' FILEVERSION '):
l = ' FILEVERSION ' + ver + '\n'
elif l.startswith(' PRODUCTVERSION '):
l = ' PRODUCTVERSION ' + ver + '\n'
else:
l = re.sub( r'(\s+VALUE\s"FileVersion",\s+)"(.*)"',r'\1"%s"' % ver1 , l )
l = re.sub( r'(\s+VALUE\s"ProductVersion",\s+)"(.*)"',r'\1"%s"' % ver1 , l )
olines.append(l)
f.close()
f = open(rc,'w')
f.writelines(olines)
f.close()
分享到:
相关推荐
基于python 批量修改文件后缀脚本
华西抢号Python脚本华西抢号Python脚本华西抢号Python脚本
全名:python-3.8.7rc1-amd64.exe python的安装与使用: https://blog.csdn.net/qq_38161040/article/details/87295245
主要介绍了如何在python中写hive脚本,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
python脚本拆分bin文件
全名:python-3.7.8rc1.exe
全名:python-3.6.4rc1.exe
我的windows浏览器搜索功能坏了,这是用python写的控制台下的查找文件脚本
编写的shell 脚本、perl 脚本、python 脚本 等如果不想被别人看到原文件,可以使用该工具shc ,对脚本文件加密,
全名:python-3.8.8rc1.exe
全名:python-3.9.2rc1.exe
python aapt 分析APK文件,获取应用包名,版本号,版本名 代码直接复制即可,亲测多次可用,
python获取文件版本号
全名:python-2.7.18rc1.msi
全名:python-3.6.6rc1.exe
python3的文件上传脚本用于文件的上传 较小的py文件,自己练习写的,供学习和参考,注释也写了应该挺清楚的。
使用Python处理S19文件,分析S19文件中的数据。能够很好地帮助分析S19文件
全名:python-3.9.1rc1.exe
全名:python-3.7.7rc1.exe
全名:Python-3.8.6rc1.tar.xz