A
Andreas Lobinger
Aloha,
i wanted to ask another problem, but as i started to build an example...
How to generate (memory and time)-efficient a string containing
random characters? I have never worked with generators, so my solution
at the moment is:
import string
import random
random.seed(14)
d = [random.choice(string.letters) for x in xrange(3000)]
s = "".join(d)
print s
which is feasible for the 3000, but i need lengths in the range
10.000 to 1.000.000.
Hoping for an answer and wishing a happy day
LOBI
i wanted to ask another problem, but as i started to build an example...
How to generate (memory and time)-efficient a string containing
random characters? I have never worked with generators, so my solution
at the moment is:
import string
import random
random.seed(14)
d = [random.choice(string.letters) for x in xrange(3000)]
s = "".join(d)
print s
which is feasible for the 3000, but i need lengths in the range
10.000 to 1.000.000.
Hoping for an answer and wishing a happy day
LOBI