- import os
- for i in range(0, 1000000):
- p = str(i)
- cmd = "winrar e xxx.rar -y -p%s" % (p)
- r = os.system(cmd)
- if r == 1 or r == 0:
- print("pass = %s" % p)
- break
- print("%s %d" % (p, r))
- #该片段来自于http://www.codesnippet.cn/detail/0911201513963.html
来源: http://www.codesnippet.cn/detail/0911201513963.html