Skip to content

This is my first real, functional Python program. The calculator can convert positive, decimal (up to 20 binary digits when converted), and negative numbers. It uses the tkinter library to provide a simple graphical interface for easier use.

Notifications You must be signed in to change notification settings

the4217/python-binary-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

python-binary-translator

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.

About

This is my first real, functional Python program. The calculator can convert positive, decimal (up to 20 binary digits when converted), and negative numbers. It uses the tkinter library to provide a simple graphical interface for easier use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages