标签:value int sel rand gen str span self turn
def strGen(self, num): """ 生成可自定义长度的数字、字母和特殊字符混合的字符串 :return: """ list1 = [chr(i) for i in range(65, 91)] + [chr(i) for i in range(97, 123)] + [str(i) for i in range(10)] + [‘.‘, ‘-‘, ‘~‘, ‘_‘] value = "" for i in range(num): value = value + list1[random.randint(0, len(list1) - 1)] return value
标签:value int sel rand gen str span self turn
原文地址:https://www.cnblogs.com/YY-kele/p/14661290.html