hanyh 发表于 2013-1-28 19:28:49

python随机字符串

contactgroup_contact
import stringrstr = ''.join(random.choice(string.letters) for i in xrange(len))import osrandom_string = os.urandom(string_length)#urandom()#Return a string of n random bytes suitable for cryptographic use.import randomjunk_len = 1024junk =(("%%0%dX" % junk_len) % random.getrandbits(junk_len *8)).decode("hex")
页: [1]
查看完整版本: python随机字符串