I found this useful, perhaps others will, too:
def Var(eq, show=False):
"""a quiet form of var that creates and injects symbols defined
either by a var-compatibile string or a SymPy expression.
Examples
========
>>> Var('x+y/z') # x, y, z created
>>> Var(x + y/z) # x, y, z created
>>> Var('x:4,y') # x0, x1, x2, x3, y created
>>> Var('x:4,y', show=True)
(x0, x1, x2, x3, y)
"""
try:
eq = S(eq)
if isinstance(eq, (list, tuple)):
eq = Tuple(*eq)
rv = var(','.join([s.name for s in eq.atoms(Symbol)]))
except:
rv = var(eq)
if show:
return rv
--
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?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.