MCPcopy Create free account
hub / github.com/geekcomputers/Python / main

Function main

random_password_gen.py:21–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20
21def main():
22 print("Random Password Generator")
23 try:
24 length = int(input("Enter desired password length: "))
25 if length < 6:
26 print(" Password length should be at least 6.")
27 return
28 password = generate_password(length)
29 print(f"\nGenerated Password: {password}")
30
31 # Save to file
32 with open("passwords.txt", "a") as file:
33 file.write(password + "\n")
34 print(" Password saved to passwords.txt")
35
36 except ValueError:
37 print(" Please enter a valid number.")
38
39
40if __name__ == "__main__":

Callers 1

Calls 1

generate_passwordFunction · 0.70

Tested by

no test coverage detected