Parse Python String for Units

后端 未结 3 1091
灰色年华
灰色年华 2021-02-13 18:12

Say I have a set of strings like the following:

\"5 m^2\"
\"17 sq feet\"
\"3 inches\"
\"89 meters\"

Is there a Python package which will read s

3条回答
  •  感情败类
    2021-02-13 18:57

    Is there an extension for ipython that can do at least part of what you want. It's called ipython-physics

    It does store value and units and allows (at least) some basic math. I have never used it myself, so I don't know how easy would be to use in a python script

提交回复
热议问题