Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Convert to and from multiple bases

Project description

BiHex

Simple base convert

How to install

pip install bihex-domedi

How to use

from BiHex import *

To create an instance, use:

foo = Bihex("b10110100"), where the letter behind the number is the base (2 = b, 8 = o, 10 = d, 16 = x)

To display the number in:

  • decimal: foo.returnnum("d"), gives "180"
  • binary: foo.returnnum("b"), gives "0b10110100"
  • hexadecimal: foo.returnnum("x"), gives "0xB4"
  • octal: foo.returnnum("o"). gives "0o264"

To display the number's original base, use foo.returnbase()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for bihex-domedi, version 0.0.6
Filename, size File type Python version Upload date Hashes
Filename, size bihex_domedi-0.0.6-py3-none-any.whl (2.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size bihex-domedi-0.0.6.tar.gz (1.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page