Skip to content

Create Password generator #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 29, 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
23 changes: 23 additions & 0 deletions Password generator
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import string
import random
from typing import List

if __name__ == "__main__":

s1 = string.ascii_lowercase
s2 = string.ascii_uppercase
s3 = string.digits
s4 = string.punctuation

plen = int(input("Enter password length\n"))

s = []
s.extend(list(s1))
s.extend(list(s2))
s.extend(list(s3))
s.extend(list(s4))

random.shuffle(s)

print("Your password is: ")
print("".join(s[0:plen]))
76 changes: 76 additions & 0 deletions Stop Watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

import tkinter as Tkinter
from datetime import datetime
counter = 66600
running = False
def counter_label(label):
def count():
if running:
global counter


if counter==66600:
display="Starting..."
else:
tt = datetime.fromtimestamp(counter)
string = tt.strftime("%H:%M:%S")
display=string

label['text']=display # Or label.config(text=display)


label.after(1000, count)
counter += 1


count()


def Start(label):
global running
running=True
counter_label(label)
start['state']='disabled'
stop['state']='normal'
reset['state']='normal'

def Stop():
global running
start['state']='normal'
stop['state']='disabled'
reset['state']='normal'
running = False


def Reset(label):
global counter
counter=66600


if running==False:
reset['state']='disabled'
label['text']='Welcome!'


else:
label['text']='Starting...'

root = Tkinter.Tk()
root.title("Stopwatch")


root.minsize(width=250, height=70)
label = Tkinter.Label(root, text="Welcome!", fg="black", font="Verdana 30 bold")
label.pack()
f = Tkinter.Frame(root)
start = Tkinter.Button(f, text='Start', width=6, command=lambda:Start(label))
stop = Tkinter.Button(f, text='Stop',width=6,state='disabled', command=Stop)
reset = Tkinter.Button(f, text='Reset',width=6, state='disabled', command=lambda:Reset(label))
f.pack(anchor = 'center',pady=5)
start.pack(side="left")
stop.pack(side ="left")
reset.pack(side="left")
root.mainloop()