#imports
import string
import secrets
#strings and variables
selection_list = string.ascii_letters + string.digits + string.punctuation
special_chars = string.punctuation
length = 29
#main code
from random import sample, choice
password = ''
for i in range(length):
password+= ''. join(secrets.choice(selection_list))
#inputs
while True:
platform = input("put the name of the platform here: ")
login = input("put the email or usernamer here : ")
#printing and writing to file
f = open("/home/matthies/Dokumente/pwords/passwörter.txt", "a")
f.write(platform)
f.write(" n")
f.write(login)
f.write(" n")
f.write(password)
f.write(" n")
f.write(" n")
f.close()
print(platform, login, password)
if platform == "exit":
break
it automatically creates a file with the platform’s name, the login data for example the email address and the password sorted in new lines.
Please give me some feedback and suggestions for the improvement of this program.
New contributor
Matthies is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.