@Jboeggs Let's assume we want all possible 7 character strings. That is 64,847,759,419,264 strings. So it takes quite some time to generate these strings. BTW thanks for the reply.
@DaNePaLI You are absolutely correct! If you don't mind I would like to point out a minor mistake in your code, you forgot to assign plist to a new list. So, here is the working code for the password generator which is much faster! Thank you very much again! If anyone is using the previous code please use this!
#!/usr/bin/python3
from itertools import product
import random
def pwdgen():
location = input("""Where do you want to store the words generated? (File Location) (Please specify the directory with / rather than \)""")
maxlen = int(input('How long should the words generated be?'))
file = open(location, 'w')
plist, variable = [], ()
while len(variable) <= maxlen:
variable += (str(random.random()), )
for variable in product(range(33, 127), repeat = maxlen):
tstring = ''
for i in range(0, maxlen):
tstring += chr(variable[i])
file.write(tstring + '\n')
plist.append(tstring)
file = open(location, 'w')
file.close()
return 'Done!'
Staff Edit
Do not double post