On Sat, May 9, 2009 at 7:12 AM, Laurent Claessens <moky.m...@gmail.com> wrote: > > I half-answer to myself : > > >> 1. be able to convert a string into a function on which I can use Sage > > s = "x**3" > var('x') > f = eval(s) > print f(3) > > makes the job > >> 2. from the results of Sage (especially from diff(f,x)), I need a >> string that I can manipulate with Python (especially use the .replace >> method in order to produce strings that are valid code for pstricks). > > s = "x**3" > var('x') > f = eval(s) > print f(3) > g = diff(f,x) > print g > > I would like to get the string "3*(x**2)" or something like that.
Is sage: str(latex(g)) '{3 {x}^{2} }' what you want? > > Thanks for any ideas > Laurent > > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---