Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/blixt/py-base
- Owner: blixt
- Created: 2011-01-21T01:37:01.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-01-21T01:46:34.000Z (almost 14 years ago)
- Last Synced: 2024-04-21T10:12:34.548Z (7 months ago)
- Language: Python
- Homepage:
- Size: 93.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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