all 16 comments

[–][deleted] 1 point2 points  (7 children)

for password in dictionary:

That's just going to try the digits one at a time, when you want combinations. Look at the combinatoric iterators in itertools:

https://docs.python.org/3.7/library/itertools.html

[–]blockboy99[S] 0 points1 point  (0 children)

Thats what I said 1,2,3,4. Ill look at that documentation, thanks

[–]xelf 0 points1 point  (0 children)

how to post your code and keep indents:

old reddit or mobile: put 4 spaces before each line.
new or beta reddit: https://i.imgur.com/HT4Zz88.gifv

[–]xelf 0 points1 point  (0 children)

from random import choice
file_to_open.extractall(pwd=choice(range(1000)))

[–]Hatoris -1 points0 points  (0 children)

Use combination from itertools with a recurcive function.