Metric Helper is a simple desktop application built using CustomTkinter that allows users to convert values between different metric prefixes (e.g., femto, nano, kilo, mega, etc.). This tool is designed for ease of use and provides a clean, modern interface.
- Metric Conversion: Convert values between various metric prefixes ranging from
femto(10⁻¹⁵) topeta(10¹⁵). - User-Friendly Interface:
- Input and output fields for entering and displaying values.
- Dropdown menus (
ComboBox) to select metric prefixes for both input and output.
- Real-Time Conversion: Click the "Convert" button to instantly calculate and display the converted value.
- Modern Design: Built with CustomTkinter, ensuring a sleek and professional look.
- Python 3.7 or higher installed on your system.
- Install the required dependencies by running:
pip install customtkinter
To get started, clone this repository to your local machine:
git clone https://github.com/Poyamohamadi/metric_helper.git
cd metric_helper-
Run the application by executing the Python script:
python main.py
-
Enter a numeric value in the Input Field.
-
Select the metric prefix for the input value from the Input ComboBox.
-
Select the desired metric prefix for the output value from the Output ComboBox.
-
Click the Convert button to see the converted value in the Output Field.
The code is organized into the following components:
-
Main Application Class (
MyApp):- Inherits from
customtkinter.CTkto create the main application window. - Initializes the GUI elements such as input/output fields, comboboxes, and buttons.
- Inherits from
-
GUI Elements:
- Input Field: For entering the numerical value.
- Comboboxes: Dropdown menus for selecting metric prefixes.
- Convert Button: Triggers the conversion logic.
- Output Field: Displays the converted value.
-
Conversion Logic (
convertMethod):- Uses a dictionary (
metric_values) to map metric prefixes to their respective powers of 10. - Converts the input value to its base unit and then to the desired output prefix.
- Uses a dictionary (
-
Main Execution Block:
- Ensures the application runs only when executed directly.
- Python: Version 3.6 or higher.
- customtkinter: A modern GUI library for Python. Install it using:
pip install customtkinter
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes and push them to your fork.
- Submit a pull request detailing your changes.
Please ensure your code adheres to the existing style and includes appropriate documentation.
This project is licensed under the MIT License. See the LICENSE file for more details.
-
CustomTkinter Library: Thanks to the developers of
customtkinterfor creating a modern and customizable GUI toolkit. -
Python Community: Special thanks to the Python community for their support and resources.
For questions or feedback, feel free to reach out:
- GitHub: Poyamohamadi
Thank you for using Metric Helper! 😊
