Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Adding new project #490

Merged
merged 1 commit into from Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added projects/.DS_Store
Binary file not shown.
Binary file added projects/Password_generator/.DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions projects/Password_generator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Password_generator
This script generate a random password
## Prerequisites
None
## How to run the script
Execute : password_generator.py
## Screenshot/GIF showing the sample use of the script
![](screenshot.png)
## Author Name
lilo550
Binary file added projects/Password_generator/logo.ico
Binary file not shown.
Binary file added projects/Password_generator/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions projects/Password_generator/password_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from tkinter import*
from random import choice
import string

class App:
def __init__(self):
self.window = Tk()
self.window.title('password_generator')
self.window.iconbitmap('logo.ico')
self.window.iconphoto(False, PhotoImage(file='logo.png'))
self.window.geometry('500x255')
self.window.config(bg='gray')

#component creation
self.label()
self.entry()
self.button()

def label(self):
label_title = Label(self.window, text='Welcome to password generator', font=('Courrier', 20), bg='gray', fg='black')
label_title.pack()

def entry(self):
self.password_entry = Entry(self.window, font=('Courrier', 25), bg='white', fg='black', width=30, relief='solid')
self.password_entry.pack(pady=50)

def button(self):
password_generator = Button(self.window, text="Generate_password", font=('Courrier', 12), bg='white', fg='black', width=25, command=self.generate_password)
password_generator.pack()

def generate_password(self):
characters = string.ascii_letters + string.punctuation + string.digits
password = ""
for x in range(28):
password+=choice(characters)
self.password_entry.delete(0, END)
self.password_entry.insert(0, password)

#display
app = App()
app.window.mainloop()