How to save output of a generated text
<p>I am using the following code to generate a text:</p>

<pre><code>for i in xrange(300):
    sys.stdout.write(alphabet[bisect.bisect(f_list, random.random())
</code></pre>

<p>and I would like to know how to store the same text (in the variable <code>text1</code>) so that I can use it later in this code:</p>

<pre><code>for i in xrange(300):
    text1=sys.stdout.write(alphabet[bisect.bisect(f_list, random.random())

for word in text1:
    fd.inc(word)
</code></pre>
