Python 获得程序 exe 的版本号
Python 获得程序 exe 的版本号
python中需要安装 pywin32 包
# based on http://stackoverflow.com/questions/580924/python-windows-file-version-attribute from win32com.client import Dispatch def get_version_via_com(filename): parser = Dispatch("Scripting.FileSystemObject") version = parser.GetFileVersion(filename) return version if __name__ == "__main__": path = r"C:\Program Files\Google\Chrome\Application\chrome.exe" print get_version_via_com(path)
未经博主允许,禁止直接转载本博客任何内容(可以在文章中添加链接,禁止原文照搬),如需直接原文转载对应文章,请在该文章中留言联系博主,谢谢!!