I cannot use R.<x> the period. The python code is in a script. I am taking the string from a form and want to convert to a polynomial then factor the expression. This is from my Twisted API.
On Jun 17, 9:23 am, Minh Nguyen <nguyenmi...@gmail.com> wrote: > Hi Mikie, > > On Thu, Jun 18, 2009 at 1:17 AM, William Stein<wst...@gmail.com> wrote: > > > On Wed, Jun 17, 2009 at 5:14 PM, Mikie<thephantom6...@hotmail.com> wrote: > > >> I taking a string from a form. How do I convert it to polynomial type? > > > sage: R.<x> = ZZ[] > > sage: R > > Univariate Polynomial Ring in x over Integer Ring > > sage: R(s) > > x^3 + 3*x - 2 > > Or something like the following: > > sage: s = "x^3 + 3*x - 2"; type(s) > <type 'str'> > sage: R.<x> = ZZ["x"]; R > Univariate Polynomial Ring in x over Integer Ring > sage: R(s) > x^3 + 3*x - 2 > > -- > Regards > Minh Van Nguyen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---