Mathematical Equations - Rendering and Evaluation with Python and QT (and sympy?)
问题 I am developing a GUI application (in the civil engineering context) with python3 and QT and want to display an equation in three different ways: symbolic: sigma=N/A with values: sigma=200kN/20cm² as a result: sigma=10kN/cm² The layout of the equation and the order of symbols has to be the same for both (1) and (2), but i only want to enter the equation once in my sourcecode. I searched a lot, this is the best i could get: class myfancy_equation(): def __init__(self): self.a = Symbol('a')