title: Slow Big Int Output in python
body: <p>Is there anyway to improve performance of "str(bigint)" and "print bigint" in python ? Printing big integer values takes a lot of time. I tried to use the following recursive technique :</p>
  
  <pre><code>def p(x,n):
      if n &lt; 10:
              sys.stdout.write(str(x))
              return
      n &gt;&gt;= 1
      l = 10**n
      k = x/l
      p(k,n)
      p(x-k*l,n)
  </code></pre>
  
  <p>n = number of digits, 
  x = bigint</p>
  
  <p>But the method fails for certain cases where x in a sub call has leading zeros. Is there any alternative to it or any faster method. ( Please do not suggest using any external module or library ).</p>