>> Has anyone added special syntax to allow writing numeric literals with >> physical units? So you can write 12m + 34cm, and would get 12.34m. ... Georg> normally you wouldn't add units to the language itself. ... Georg> For the interactive shell, using a wrapper that allows simplified Georg> input is also a possibility, like IPython's "-profile physics" Georg> mode, or something like http://bitbucket.org/birkenfeld/phsh/ Georg> which allows you to write >>>> `1 m` + `12 cm` Georg> 1.12 m Also, check out the magnitude module (in PyPI). I use it to specify the units of the computation but allow users to input values using units which are meaningful to them. So, for example, if a value has units of time they could enter 1m or 60s and get the same internal value. Skip
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4