Christophe wrote:
> Hello,
> suppose that we have the following expression :
>             (x**2+1)*(log(x+4)-7)
> 
> I would like to know that is a product and to have :
>              (x**2+1) and (log(x+4)-7).

You need to play a little with the args attribute. Try this

y = (x**2+1)*(log(x+4)-7)
print y.args

for z in y.args:
     if isinstance(z, Add):
         for a in z.args:
             print a, a.__class__
         print

It is not exactly what you need, but gets close.

cheers,

Toon

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

Reply via email to