时间:2020-12-24 12:22:21 | 栏目:Python代码 | 点击:次
使用python自带的itertools模块
调用其product函数
传入我们想组合生成的字符数据
便会源源不断的生成组合
而且不会重复
repeat参数指定生成多少位
import itertools mylist=("".join(x) for x in itertools.product("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",repeat=16)) while True: print(next(mylist))
结果:
0000000000003MCk 0000000000003MCl 0000000000003MCm 0000000000003MCn 0000000000003MCo 0000000000003MCp 0000000000003MCq 0000000000003MCr 0000000000003MCs 0000000000003MCt 0000000000003MCu 0000000000003MCv 0000000000003MCw 0000000000003MCx 0000000000003MCy 0000000000003MCz 0000000000003MCA 0000000000003MCB 0000000000003MCC