-
Notifications
You must be signed in to change notification settings - Fork 0
/
setpassword.py
62 lines (55 loc) · 1.81 KB
/
setpassword.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from datetime import datetime
from random import randint
import sys
today=datetime.now()
fp1=open("mypasswords.txt","a")
fp2=open("mypasswords.txt","r")
td=today.strftime("%d %B,%Y %A")
for i in range(6):
print()
print("\t%s"%td)
print("\tWelcome Srinivas pavan")
for i in range(3):
print()
print("Chose an option :")
while(True):
print("\t1.Set Password")
print("\t2.Show Password List")
print("\t3.Exit(Press any key to exit)")
print("\tYour option :",end=" ")
inp=input()
if(inp=='1'):
pw=randint(1000,9999)
linelist=fp2.readlines()
lastline=linelist[-1]
mystr=td+" Password: "+str(pw)+"\n"
fp1.write(mystr)
print("Previous :",end=" ")
print(lastline)
print("\t\tYour new Password: %d"%pw)
print("\t\tExit now(Yes=y/Y || No=n/N): ",end=" ")
ex=input()
ex=ex.upper()
if(ex=='Y'):
print("Pain is temporary. It may last for a minute, or an hour or a day, or even a year. But eventually, it will subside. And something else takes its place. If I quit, however, it will last forever.")
print("Have a great day")
sys.exit(0)
else:
pass
elif(inp=='2'):
content=fp2.read()
print("Your Passwords :")
print(content)
print("\t\tExit now(Yes=y/Y || No=n/N): ",end=" ")
ex=input()
ex=ex.upper()
if(ex=='Y'):
print("Pain is temporary. It may last for a minute, or an hour or a day, or even a year. But eventually, it will subside. And something else takes its place. If I quit, however, it will last forever.")
print("Have a great day")
sys.exit(0)
else:
pass
else:
print("Sometimes it ain’t about being the most talented. Sometimes it ain’t about being the smartest. Sometimes it’s not even about working the hardest. Sometimes it’s about consistency! Consistency!")
print("Have a great day")
sys.exit(0)