python随机字符串

contactgroup_contact
import string
rstr = ''.join(random.choice(string.letters) for i in xrange(len))


import os
random_string = os.urandom(string_length)
#urandom()
#  Return a string of n random bytes suitable for cryptographic use.


import random
junk_len = 1024
junk =  (("%%0%dX" % junk_len) % random.getrandbits(junk_len *
8)).decode("hex")

你可能感兴趣的:(java,python,OS)