Skip to content

peternielsen112/binarytranslate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Binary Translator

Github All Releases GitHub release GitHub Release Date GitHub license GitHub stars


Contents


Requirements

  • Python 3.7 or above
  • No modules are required.

About

Binary Translator ia a simple Python repository that translates numbers into binary. This program is copyright (C) 2021 Peter Nielsen. See LICENSE.md for more details.


Instructions

Git Bash:
  1. Navigate to the folder in Git Bash. cd C:/example/path/to/binarytranslate.

  2. Run the main file using the command: python main.py. Python must be installed on your system for this operation to complete.

  3. When prompted, enter an integer up to 65535.

  4. Output in binary is given.

Terminal.app:
  1. Navigate to the folder in Terminal: cd ~/example/path/to/binarytranslate
  2. Run the main file using this command: python3 main.py. Python must be installed on your system for this operation to complete.
  3. When prompted, enter an integer up to 65535.
  4. Output in binary is given.
File Browsing GUIs:
  1. Navigate to the folder in Windows Explorer or Finder (MacOS).

  2. Double-click on the file and it will open a Python shell. Python must be installed on your system for this operation to complete.

  3. When prompted, enter an integer up to 65535.

  4. Output in binary is given.


How it Works:

The program takes input from the user using Python's out-of-the-box input() function. This input is saved as a variable, user_input. Then, for every binary place in a large range, that amount is subtracted if the number is great enough to meet a binary value. During each calculation, the program determines whether to set that place's digit to 1 or 0. The digits are combined and then printed to the console using an f string. If an option that is higher than 65535 is given, it returns an error message; another error will be returned if the input is not an integer (using a try/except statement).


About the Creator

I create programs in a variety of languages, from Python to JavaScript to CSS and more. I'm on GitHub: @peternielsen112 and also Replit.com by the same username. Please email any problems or suggestions to me at [email protected].

About

A simple python program and repository around it that translates simple characters into binary.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages