title: Finding Rational Root of Polynomial in Python
body: <p>I am having a little issue regarding  solving polynomial in python's <code>sympy.solvers</code>. What I want is to find the rational root, not irrational root. my attempt is given below - </p>
  
  <pre><code>from sympy.solvers import solve
  from sympy import Symbol
  from fractions import Fraction
  
  b_2=0
  b_4= -10
  b_6=32
  b_8=-25
  
  x_2p=-7/4
  
  x = Symbol('x', real=True)
  solution=solve(((4*x**3+b_2*x**2+2*b_4*x+b_6)*x_2p-(x**4-b_4*x**2-2*b_6*x-b_8)), x)
  R=solution
  if len(R) != 0:
      print(Fraction(R[1]))
  </code></pre>
  
  <p>I got below error - </p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\Roy\Desktop\EXP_2704 - Copy.py", line 16, in &lt;module&gt;
      print(Fraction(R[1]))
    File "C:\Program Files\Python37\lib\fractions.py", line 161, in __new__
      raise TypeError("argument should be a string "
  TypeError: argument should be a string or a Rational instance
  </code></pre>
  
  <p>Note that I need to get accurate fraction from floating.  </p>
  
  <p>How can I find  rational root?</p>