This is my first real, functional Python program. It is a simple decimal-to-binary converter that supports positive, negative, and decimal numbers (up to 20 binary digits after the comma). The program uses the Tkinter library to provide a clean and easy-to-use graphical interface.
/////Features
Converts positive, negative, and decimal numbers
Handles up to 20 binary digits for fractional parts
Simple and intuitive Tkinter GUI
Real-time conversion by pressing Enter or clicking Convert
/////Requirements
You need Python 3.8 or newer. Tkinter is included by default in most Python installations, but if necessary, you can install it manually:
sudo apt install python3-tk
or on windows:
pip install tk
/////Usage
Download or clone this repository.
Run the script:
python traducteur_binaire.py
Enter a decimal number (integer or float).
Click “Convert” or press “Enter”.
The binary result will appear below.
/////How it works
The program:
Reads the input as a string.
Separates the integer and decimal parts.
Converts both to binary (integer using division by 2, decimal using multiplication by 2).
Combines them into a readable binary representation.
It limits fractional conversion to 20 binary digits to prevent infinite loops.
/////Author
Olivier Malnoury Made with Python and Tkinter.