blob: 66734bc66945d219c7b8d5bd9ac08535cebe895e (
plain)
1
2
3
4
5
6
7
8
9
|
import random
import string
# 生成2000个随机字符
random_chars = ''.join(random.choices(string.ascii_letters + string.digits, k=2000))
# 将结果写入txt文件
with open('random_chars.txt', 'w') as f:
f.write(random_chars)
|