简体   繁体   中英

sympy output in IPython

I am very new to coding in Python and using the IPython notebook.

My question: is it possible to get the input-format of an output I get from previous calculations? For example, if I obtain an output in latex like $x^2$ how can I get x**2 automatically?

Call str on the expression. For example

>>> from sympy import symbols
>>> x = symbols('x')
>>> str(x**2)
'x**2'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM