I am using the following code to generate a text:
for i in xrange(300):
sys.stdout.write(alphabet[bisect.bisect(f_list, random.random())
and I would like to know how to store the same text (in the variable text1) so that I can use it later in this code:
for i in xrange(300):
text1=sys.stdout.write(alphabet[bisect.bisect(f_list, random.random())
for word in text1:
fd.inc(word)
Something like this?