pure python code to do modular-arithmetic unit conversions?
Michael Spencer
mahs at telcopartners.com
Fri Jan 21 23:11:59 EST 2005
Dan Stromberg wrote:
> Is there already a pure python module that can do modular-arithmetic unit
> conversions, like converting a huge number of seconds into months,
> weeks... or a bandwidth measure into megabits/s or gigabits/s or
> megabytes/s or gigabytes/s, whatever's the most useful (ala df -h)?
>
> Thanks!
>
Take a look at:
http://home.tiscali.be/be052320/Unum_tutorial.html
From the intro:
"Unum stands for 'unit-numbers'. It is a Python module that allows to define and
manipulate true quantities, i.e. numbers with units such as 60 seconds, 500
watts, 42 miles-per-hour, 100 kg per square meter, 14400 bits per second, 30
dollars etc. The module validates unit consistency in arithmetic expressions; it
provides also automatic conversion and output formatting."
Michael
More information about the Python-list
mailing list