Published 2020-05-28T02:13:00.001Z by Physics Derivation Graph

I'm using SymPy to work with Latex expressions>>>

>>>

'1.5.1'

I can convert Latex to SymPy using

>>>

>>>

>>>

a*m

However, to work with the symbols in SymPy I need to extract them from the expression

>>>

>>>

{a, F, m}

The entries exist in the set

>>>

<class 'sympy.core.symbol.Symbol'>

but they are not defined as Python variables

>>>

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

NameError: name 'F' is not defined

To associate a Python variable with each symbol, I used

>>>

...

Then the Python variable "F" is associated with the Sympy Symbol "F"

>>>

F

>>>

<class 'sympy.core.symbol.Symbol'>

For the relevance of this thread, see

https://groups.google.com/d/msg/sympy/_RnbbOqhERM/YAoJAbyPAgAJ