On Monday, December 12, 2011 5:13:00 PM UTC-8, Michael Orlitzky wrote:
Is there an easy way to print a symbolic expression so that it's valid
python code? E.g.
2*x^2 -- QQ(2) * x**QQ(2)
How about
sage: preparse('2*x^2')
'Integer(2)*x**Integer(2)'
--
John
--
To post to
On 12/12/2011 10:05 PM, John H Palmieri wrote:
On Monday, December 12, 2011 5:13:00 PM UTC-8, Michael Orlitzky wrote:
Is there an easy way to print a symbolic expression so that it's valid
python code? E.g.
2*x^2 -- QQ(2) * x**QQ(2)
How about
sage: preparse('2*x^2')