Skip to main content

A tool for conversion numbers from one base to another

Project description

# python-radix

Python-radix library

The library contains tools for conversion numbers to a new base. Current version works with radixes from 2 to 36.

Python-radix usage examples

Python-radix has both procedural and object-oriented solutions.

Procedural way example

# to convert number 4 from base 10 to base 2

cast(4, 10, 2)

>>‘100’

You can use both str and int types for the number you convert.

Object oriented way example

# create an object to convert numbers from one base to another (here it converts from base 10 to base 2)

new = Converter(10, 2)

new.convert(4)

>>‘100’

This will work too:

new = Converter(10, 2)

new.convert(‘4’)

>>‘100’

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 python-radix, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size python_radix-0.1.1-py2.py3-none-any.whl (4.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size python-radix-0.1.1.tar.gz (2.1 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