# cat genpass.py from random import choice import string def GenPasswd(length=20, chars=string.letters+string.digits): return ‘‘.join([choice(chars) for i in range(length)]) for i in range(6): print GenPasswd(20)
运行结果为:
# python genpass.py mv2yMlDEyQFcujkh7ttM 4fNmbh2atrcrsrKm1f3t UKRPsUsdZ951uQBdtPhS bAuHJUbNXBSjB5IVibQO d7Dl0VGAOI0LcGlnJOeR qb2WEHwHTVYK51gZsa2V
时间: 2024-10-09 16:42:52