MCPcopy Index your code
hub / github.com/geekcomputers/Python / find_password

Function find_password

Password Manager Using Tkinter/main.py:70–87  ·  view source on GitHub ↗

finds and displays password for a given website.

()

Source from the content-addressed store, hash-verified

68
69# ---------------------------- FIND PASSWORD ------------------------------- #
70def find_password():
71 """finds and displays password for a given website."""
72 website = website_entry.get()
73 try:
74 with open("data.json", "r") as data_file:
75 data = json.load(data_file)
76 except (FileNotFoundError, json.JSONDecodeError):
77 messagebox.showerror(title="Error", message="No Data File Found.")
78 return
79
80 if website in data:
81 email = data[website]["email"]
82 password = data[website]["password"]
83 messagebox.showinfo(title=website, message=f"Email: {email}\nPassword: {password}")
84 pyperclip.copy(password)
85 messagebox.showinfo(title="Copied", message="Password for {} copied to clipboard.".format(website))
86 else:
87 messagebox.showerror(title="Error", message=f"No details for {website} exists.")
88
89# ---------------------------- VIEW ALL PASSWORDS ------------------------------- #
90def view_all_passwords():

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
loadMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected