Yep.  .args is basically the key to doing advanced stuff in SymPy.  You can 
access any part of an expression you want by walking the .args tree, and you 
can use it to do any kind of manipulation you want.  Basically, if you look at 
the source for many of these functions like collect() or as_independent(), they 
are doing nothing more than walking .args and moving things around there.

Happy coding!

Aaron Meurer

On Sep 21, 2010, at 9:59 PM, Nicholas Kinar wrote:

>> 
>> Try using .args, as in
>> 
>> expr.args
>> 
>> Aaron Meurer
>>   
> 
> Thanks, Aaron; that's the icing on the cake, and it is exactly what I needed. 
>  Isn't it neat how expr.args can be cascaded?
> 
> expr1 = expr0.args[0].args[1].args[1]
> 
> Nicholas

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to