How can I convert an absolutely massive number to a string in a reasonable amount of time?
<p>This is quite an odd problem I know, but I'm trying to get a copy of the current largest prime number in a file. Getting the number in integer form is fairly easy. I just run this.</p>

<pre><code>prime = 2**74207281 - 1
</code></pre>

<p>It takes about half a second and it works just fine. Operations are fairly quick as well. Dividing it by 10 (without decimals) to shift the digits is quick. However, <code>str(prime)</code> is taking a very long time. I reimplemented <code>str</code> like this, and found it was processing about a hundred or so digits per second.</p>

<pre><code>while prime &gt; 0:
    strprime += str(prime%10)
    prime //= 10
</code></pre>

<p>Is there a way to do this more efficiently? I'm doing this in Python. Should I even try this with Python, or is there a better tool for this?</p>