From bc6b3982bf7943e9d33fafc037c1bb11ad53aa9c Mon Sep 17 00:00:00 2001 From: Aram-Ibrahim Date: Wed, 4 Sep 2024 12:59:12 +0000 Subject: [PATCH 1/6] Update README.md --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d097bd7..54209c5 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ # PasswordGenerator +Python password generation app with GUI. -### Settings -To set password characters, use the file settings.json and in the characters clause, change them to the characters you need +# Requirements: + - customtkinter + +# How to run the password generator? +run `python main.py` -### Using -```# clone the repo -pip install customtkinter -$ git clone https://github.com/pydragon1/PasswordGenerator.git -cd PasswordGenerator -python main.py From c70d24a20e5ca48da618ded7a9e2d47a857d2a9e Mon Sep 17 00:00:00 2001 From: Aram-Ibrahim Date: Wed, 4 Sep 2024 13:17:30 +0000 Subject: [PATCH 2/6] Delete PasswordGenerator/settings.json --- PasswordGenerator/settings.json | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 PasswordGenerator/settings.json diff --git a/PasswordGenerator/settings.json b/PasswordGenerator/settings.json deleted file mode 100644 index 0656449..0000000 --- a/PasswordGenerator/settings.json +++ /dev/null @@ -1,6 +0,0 @@ - -{ -"characters": "1234567890", -"password_length": 8, -"numbers_pieces": 1 -} From c231f300abc52ba1ccc0f171e8648ed75b94b079 Mon Sep 17 00:00:00 2001 From: Aram-Ibrahim Date: Wed, 4 Sep 2024 13:48:59 +0000 Subject: [PATCH 3/6] Update main.py --- PasswordGenerator/main.py | 49 ++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/PasswordGenerator/main.py b/PasswordGenerator/main.py index 0e3a5fb..9de15bb 100644 --- a/PasswordGenerator/main.py +++ b/PasswordGenerator/main.py @@ -1,50 +1,47 @@ import customtkinter as ct import random -import json - +import string +import pyperclip app = ct.CTk() +def slider_cmd(val): + label_info_length.configure(text=int(val)) -with open('settings.json') as setting: - settings_data = json.load(fp=setting) - - -def slider_command(value): - label_info_length.configure(text=int(value)) - - -def generate_password(): +def gen_passwd(): length = int(slider.get()) - characters = settings_data['characters'] + characters = string.ascii_letters + string.digits + string.punctuation password = ''.join(random.choices(characters, k=length)) label_password.configure(text=password) +def copy_passwd(): + password = label_password.cget("text") + pyperclip.copy(password) -app.geometry('470x270') +app.geometry('500x300') app.resizable(False, False) -app.title("Password generator") - +app.title("Password Generator") -slider_frame = ct.CTkFrame(app, width=460, height=50) -slider_frame.pack(side='bottom' ,pady=5) +slider_frame = ct.CTkFrame(app, width=500, height=70) +slider_frame.pack(side='top', pady=5) slider_label = ct.CTkLabel(slider_frame, text='Password Length: ', font=('Arial', 12)) slider_label.pack(side='left') -slider = ct.CTkSlider(slider_frame,command=slider_command, from_=1, to=settings_data['max_password_length']) +slider = ct.CTkSlider(slider_frame, command=slider_cmd, from_=10, to=50) +slider.set(15) slider.pack(side='left') - -label_info_length = ct.CTkLabel(slider_frame, text='20') +label_info_length = ct.CTkLabel(slider_frame, text='15') label_info_length.pack(side='left', pady=20) -btn_generate = ct.CTkButton(app, text='Generate', width=140, height=40, command=generate_password) -btn_generate.pack(side='bottom', pady=15) - +generate_btn = ct.CTkButton(app, text='Generate', width=150, height=50, command=gen_passwd) +generate_btn.pack(side='top', padx=10,pady=10) +copy_btn = ct.CTkButton(app, text='Copy', width=100, height=50, command=copy_passwd) +copy_btn.pack(side='bottom', padx=10,pady=10) -pass_frame = ct.CTkFrame(app, width=460, height=100) -pass_frame.pack(anchor='n', pady=5) -label_password = ct.CTkLabel(pass_frame, text='hello', width=460, height=100, font=('Arial', 18)) +passwd_frame = ct.CTkFrame(app, width=500, height=150) +passwd_frame.pack(anchor='n', pady=5) +label_password = ct.CTkLabel(passwd_frame, text='hello', width=500, height=150, font=('Arial', 18)) label_password.pack() app.mainloop() From 0d97302a2901f217c0d24b3dbbd66d17ee3445fa Mon Sep 17 00:00:00 2001 From: Aram-Ibrahim Date: Wed, 4 Sep 2024 13:55:54 +0000 Subject: [PATCH 4/6] Update main.py --- PasswordGenerator/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PasswordGenerator/main.py b/PasswordGenerator/main.py index 9de15bb..0613d86 100644 --- a/PasswordGenerator/main.py +++ b/PasswordGenerator/main.py @@ -41,7 +41,7 @@ def copy_passwd(): passwd_frame = ct.CTkFrame(app, width=500, height=150) passwd_frame.pack(anchor='n', pady=5) -label_password = ct.CTkLabel(passwd_frame, text='hello', width=500, height=150, font=('Arial', 18)) +label_password = ct.CTkLabel(passwd_frame, text='Use Generate button', width=500, height=150, font=('Arial', 18)) label_password.pack() app.mainloop() From 5a3d7eb52df054ce90aa348e73f0b1104b2e4257 Mon Sep 17 00:00:00 2001 From: Aram-Ibrahim Date: Wed, 4 Sep 2024 13:58:59 +0000 Subject: [PATCH 5/6] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 54209c5..261515c 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Python password generation app with GUI. # Requirements: - customtkinter + - pyperclip + # How to run the password generator? run `python main.py` From ac4a706c9d716db78fadc2ec5f286c971ed03428 Mon Sep 17 00:00:00 2001 From: Aram-Ibrahim Date: Wed, 4 Sep 2024 14:06:46 +0000 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 261515c..d4e9b7a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # PasswordGenerator -Python password generation app with GUI. +Secure python password generation app with GUI. # Requirements: - customtkinter