Processing equivalent to RandomStringUtils.randomAlphabetic (n)
of commons-lang (Java). If you look it up, it will come out, but as a memorandum.
random_string
import string
import random
n = 5
#It may be convenient to make it a utility function?
random_str = ''.join([random.choice(string.ascii_letters + string.digits) for i in range(n)])
Recommended Posts