There is also dotprint(). That, along with srepr(), is what the
tutorial uses to explain how expressions are implemented as a tree(*)
http://docs.sympy.org/latest/tutorial/manipulation.html. In the SymPy
Live shell, you can change the output format to Repr to always get the
srepr() form of an expression.

(*) actually a DAG. Common subexpressions may be the same object. This
is done for all singletonized objects in S, and also for many other
objects when the cache is enabled.

Aaron Meurer


On Tue, Mar 4, 2014 at 2:09 PM, Ondřej Čertík <[email protected]> wrote:
> On Tue, Mar 4, 2014 at 12:25 PM, Mateusz Paprocki <[email protected]> wrote:
>> Hi,
>>
>> On 3 March 2014 16:30, Christophe Bal <[email protected]> wrote:
>>> Hello.
>>>
>>> Is there an equivalent of FullForm that produces simple treeview of a
>>> formula ? Here is basic example seen in a video.
>>>
>>> FullForm[x**2+x**3] = Plus[Power[x, 2], Power[y, 3]]
>>>
>>
>> In [1]: srepr(x**2 + x**3)
>> Out[1]: "Add(Pow(Symbol('x'), Integer(3)), Pow(Symbol('x'), Integer(2)))"
>
> Ah yes, this is what I was trying to find. Thanks Mateusz!
>
>>
>> Note that `repr()` won't work due to bugs in Python (it's wired to str()):
>>
>> In [2]: repr(x**2 + x**3)
>> Out[2]: 'x**3 + x**2'
>>
>> Mateusz
>>
>>> Best regards.
>>> Christophe BAL
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "sympy" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/sympy.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/sympy/CAAb4jGnmdpAEwhGRYEfdQUv_J1z2Oc60A1QWZbKiLSvHZVxd3A%40mail.gmail.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sympy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/sympy.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sympy/CAGBZUCa3eAaztQ2jQZSd5ETRA9t370qzo7GrbAR1kPU1%3D-USdg%40mail.gmail.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/CADDwiVBE4BxUdY_bn%3DkkhAdSK98RYmk9mwHBbXwbKhcKzNg5qw%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6K3AVJX54uQ%3DHX%2BR%2Bwd3rhaJ02b%3D2xT%2Ba57wO1%2BrCgtGg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to