# -*- coding: UTF-8 -*-
import random
def generate_random_str(len):
str = ""
for i in range(len):
str += random.choice('abcdefghijklmnopqrstuvwxyz!@#$%^&*()')
return str
if __name__ == '__main__':
fd = open("test.txt", "w")
str = generate_random_str(256)
print("context:" + str)
fd.write(str)
fd.close()
三、实现结果
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)