Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/blixt/py-base

Convert numbers between arbitrary bases.
https://github.com/blixt/py-base

Last synced: about 1 month ago
JSON representation

Convert numbers between arbitrary bases.

Awesome Lists containing this project

README

        

# Python base module

## Information

The `base.rebase` function provided by this package can be used to convert
numbers between arbitrary bases.

## Examples

>>> import base
>>> base.rebase('80', base.HEX, base.DECIMAL)
'128'
>>> base.rebase(-255, base.DECIMAL, base.HEX)
'-FF'
>>> base.rebase('1111', base.BINARY, base.DECIMAL)
'15'

## MIT license

This project is licensed under an [MIT license][].

Copyright © 2011 Andreas Blixt ()

[MIT license]: http://www.opensource.org/licenses/mit-license.php