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

Class Interface

Password Generator/pass_gen.py:30–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29
30class Interface:
31 has_characters = {
32 "lowercase": True,
33 "uppercase": True,
34 "digits": True,
35 "punctuation": True,
36 }
37
38 @classmethod
39 def change_has_characters(cls, change):
40 try:
41 cls.has_characters[
42 change
43 ] # to check if the specified key exists in the dicitonary
44 except Exception as err:
45 print(f"Invalid \nan Exception: {err}")
46 else:
47 cls.has_characters[change] = not cls.has_characters[
48 change
49 ] # automaticly changres to the oppesite value already there
50 print(f"{change} is now set to {cls.has_characters[change]}")
51
52 @classmethod
53 def show_has_characters(cls):
54 print(cls.has_characters) # print the output
55
56 def generate_password(self, lenght):
57 sequence = PasswordGenerator.gen_sequence(list(self.has_characters.values()))
58 print(PasswordGenerator.gen_password(sequence, lenght))
59
60
61def list_to_vertical_string(list):

Callers 1

decide_operationMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected