Answer the question
In order to leave comments, you need to log in
Is the text overlaying itself?
When I load lines in txt, they overlap each other, because of this, only the last password is displayed in txt Question, how can I make sure that each option that is generated by the program is in a separate line Thank you in advance for your answer!
A = "0123456789QWERTYUIOPASDFGHJKLZXCVBNM1234567890-=\.,/qwertyuiopasdfghjklzxcvbnm,.;["
base = len(A)
n = 0
l = 0
while True:
password = ""
temp = n
while len(password) < 1:
rest = temp % 82
temp =temp // 82
password = A[rest] + password
print(n, password)
F = open("txt","w")
for i in password:
F.write(str(n)+ password + '\n')
F.close
if password == A[-1]*1:
l += 1
n = 0
else:
n += 1
time.sleep(1)
Answer the question
In order to leave comments, you need to log in
Open the file in write mode - all previous content is deleted. "a" mode suits you
I'll add that
F.close
does absolutely nothing because you don't call the close method.
Should be
F.close()
Better yet, replace this:
F = open("txt","w")
for i in password:
F.write(str(n)+ password + '\n')
F.close
with open("txt","w") as F:
for i in password:
F.write(str(n)+ password + '\n')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question