- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get Application Version using Python
In software industries, whenever developers add a new feature, fix bugs in a particular application, they name the application to a new version, as it helps to recognize the recently updated features in that application.
Using Python, we can get the version of any application. We will use pywin32 to interact with the executable files. It provides access to the win32 API which gives the ability to create COM and objects.
First, install the required package by typing pip install pywin32 in the command shell.
Import Dispatch to get the version number of the application.
Create a variable to store the location of the application.
Define a function for getting the version that takes the location of the executable file and parses using the Dispatch method.
Return the version number using GetFileVersion(app_location) method.
In this example, we try to get the version of Chrome Application in our System, #Import the required Module from win32com.client import Dispatch def get_version_number(app_location): parser = Dispatch("Scripting.FileSystemObject") version = parser.GetFileVersion(app_location) return version app_location = r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' version = get_version_number(app_location) print(version)
Running the above code will print the version of the Chrome Application.
Now, try to give the location of another application to retrieve its version number.
- How to get android application version name?
- How to get the IIS Application Pool names using PowerShell?
- How to get programmatically android version number?
- How can I get the current Android SDK version programmatically using Kotlin?
- First Bad Version in Python
- Compare Version Numbers in Python
- How to get the IIS Application Pool queue length using PowerShell?
- How to get the IIS Application Pool failure Settings using PowerShell?
- How to get the IIS Application Pool Recycle settings using PowerShell?
- How to get programmatically android Radio version information?
- Get a list of MySQL databases and version?
- Java Program to get Operating System name and version
- How to get default device sdk version in android?
- How to get the Application security groups of the Azure VM using PowerShell?