Python用组合排列找出对应排列(密码破解)

import  time
import itertools

#破解简单密码。需要时间
#repeat 选取6位
#itertools.product() 组合排列

passwd=("".join(x) for x in itertools.product("0123456789",repeat=6))
while True:
try:
str = next(passwd)
time.sleep(0.0001)#让cpu停下
print(str)

except StopIteration as e:#打印结束退出
break

猜你喜欢

转载自www.cnblogs.com/zlong123/p/10514833.html