--通过python脚本生成随机密码并存储到文件中。
--随机生成16位密码
import random
user=input("请输入用户名称(回车确认):")
pool = "1234567890abcdefghijklmnopqrstuvwxyzQWERTYUIOPASDFGHJKLZXCVBNM!@#¥%&*()"
length = len(pool)
passwd = ""
for i in range(16):
c = random.randint(0,length)
passwd=passwd+pool[c:c+1]
print(passwd)
result="{} // {}".format(user,passwd)
file = open("D:\PASSWD.txt", "a")
file.write(result)
file.write('\r\n')
file.close
本文介绍了一个简单的Python脚本,该脚本可以生成16位的随机密码,并将用户名及生成的密码存储到指定文件中。此方法适用于需要批量创建安全密码的场景。
1933

被折叠的 条评论
为什么被折叠?



