使用 'units 模块执行单位之间的基本转换。然而,似乎不可能在升和毫升之间进行简单的转换......为什么?
>>> from units import unit
>>> one_liter = unit('L')(1)
>>> one_liter
Quantity(1, LeafUnit('L', False))
>>> unit('mL')(one_liter)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/heinz/src/units/lib/python2.6/site-packages/units/abstract.py", line 23, in __call__
raise IncompatibleUnitsError()
units.exception.IncompatibleUnitsError