import random#导入随机模块
def fileduoduo(n):
file_name = random.randint(000000, 999999)#文件名按六位数字随机生成
content = random.randint(000000000,999999999)
n+=1
if n <=50:#假定随机生成50个TXT文件
d = open("%s.txt" % file_name, ‘w‘)#文件名
d.write("%s"%content)#文件内容随机写入10位数字
return fileduoduo(n)
fileduoduo(0)
原文地址:https://www.cnblogs.com/o8o8o8/p/8455487.html
时间: 2024-12-13 16:11:58