A Python-based GUI tool for converting numbers between different bases.
- Download the latest Windows release from the releases page.
- Extract the contents to a desired location.
- Run the
BaseConverter.exe
file.
- Download the latest Linux release from the releases page.
- Extract the contents to a desired location.
- Make the BaseConverter file executable by running the following command in the terminal:
chmod +x BaseConverter
- Run the BaseConverter file by navigating to the directory in the terminal and executing:
./BaseConverter
To install and run the application from source:
-
Clone the repository:
git clone https://github.com/LukeWait/base-converter.git cd base-converter
-
(Optional) Create and activate a virtual environment:
- Windows:
python -m venv base_converter_venv base_converter_venv\Scripts\activate
- Linux:
python3 -m venv base_converter_venv source base_converter_venv/bin/activate
- Windows:
-
Install the dependencies:
pip install -r requirements.txt
-
Run the application:
- Windows:
python src\base_converter.py
- Linux:
python src/base_converter.py
- Windows:
Use the input field to enter either an integer, binary, or hexadecimal number and choose the appropriate type from the combo box. Upon clicking convert, the number will be displayed as all three options in the labeled output areas.
You can enter multiple numbers by using a "." as a separator. For example, an IP address entered as an integer: 192.168.1.1
, will be displayed as binary: 11000000.10101000.1.1
, and hexadecimal: C0.A8.1.1
.
The pyqt_gui.ui
file can be opened and edited with PyQt Designer. PyQt Designer is a tool for designing and building GUIs from Qt widgets graphically and is included in pyqt5-tools==5.15.9.3.3.
To open PyQt Designer from the cloned GitHub repository:
-
Windows: Navigate to the
Scripts
folder of your virtual environment or Python installation and rundesigner.exe
.base_converter_venv\Scripts\qt5-tools.exe designer
-
Linux:
.base_converter_venv/lib/python3.11/site-packages/qt5_applications/Qt/bin/designer
Project files in PyQt Designer are saved as .ui
. To convert the .ui
file to a .py
file, use the following command:
pyuic5 -o src/pyqt_gui.py src/pyqt_gui.ui
To build executables for Windows, macOS, and Linux, you can use PyInstaller. I recommend using PyInstaller version 6.1.0 as it is stable and doesn't result in the executable being flagged as a virus like some newer versions. First, ensure you have PyInstaller installed:
pip install pyinstaller==6.1.0
Then, run the following command to create an executable:
pyinstaller --onefile --noconsole src/base_converter.py
This will generate the executable in the dist
directory. It will also create a build
directory and .spec
file. These are used in the build process and can be safely removed.
This project is licensed under the MIT License. See the LICENSE file for details.
The source code for this project can be found in the GitHub repository: https://github.com/LukeWait/base-converter.
For those building from source, the dependencies listed in requirements.txt
are:
- PyQt5==5.15.9
- pyqt5-tools==5.15.9.3.3