用Python做的一个账号密码工具
这个程序比较简单,但我还是编了4小时{:5_104:}C:\Users\Charlie\Desktop\捕获.PNG
主界面是这样的:
C:\Users\Charlie\Desktop\捕获1.PNG
static/image/hrline/line7.png
上代码!
#曲速飞跃作
#请提前在保存此代码的地方创建1.txt
import easygui as g
a = open('1.txt')
b = a.read()
e = int(b)
if e == 1:
d = g.enterbox('查看密码?')
h = int(d)
c = open('mimas.txt')
k = c.read()
f = int(k)
if h != f:
h = g.enterbox('再次输入查看密码?')
if h != f:
exit(0)
else:
pass
else:
pass
while True:
msg = '主页'
title = '密码工具'
choices = ['我的账号密码','增加账号密码','设置','退出']
choices = g.choicebox(msg,title,choices)
if choices == '增加账号密码':
msg = '增加'
title = '密码工具'
table = g.enterbox('平台?')
name = g.enterbox('账号?')
message = g.enterbox('密码?')
mes = message + "I LOVE STUDY 0962135 qusufeiyuezuo"
with open('pingtai.txt', 'a+') as f:
f.write(str(table))
f.write('\r\n')
with open('zhanghao.txt', 'a+') as f:
f.write(str(name))
f.write('\r\n')
with open('mima.txt', 'a+') as f:
f.write(str(mes))
f.write('\r\n')
elif choices == '我的账号密码':
a = open('pingtai.txt')
pt = a.read()
c = open('zhanghao.txt')
zh = c.read()
e = open('mima.txt')
message = e.read()
First = message
Second = "I LOVE STUDY 0962135 qusufeiyuezuo"
end = ""
for i in First:
if i in Second:
First = First.replace(i, "")
g.msgbox('平台:' + pt + '账号:' + zh + '密码:' + First )
elif choices == '设置':
msg = '设置'
title = '密码工具'
choices = ['使用说明','删除账号密码','设置查看密码']
choices = g.choicebox(msg, title, choices)
if choices == '使用说明':
g.msgbox('这个工具用于帮助记不住密码的人。点击增加账号密码可增加,点击我的账号密码即可查询。在设置-设置查看密码 可以设置密码。')
elif choices == '删除账号密码':
g.msgbox('在此程序保存的位置找到pingtai.txt,zhanghao.txt,mima.txt,删除对应信息即可。')
elif choices == '设置查看密码':
mima = g.enterbox('密码?(数字)')
with open('mimas.txt', 'w') as f:
f.write(str(mima))
with open('1.txt', 'w') as f:
f.write(str(1))
elif choices == '退出':
exit(0)
特别说明:
1.此代码应该是有Bug的,欢迎大家前来指导!
2.作为密码工具,密码肯定得有保密措施,我使用的方法最简单:
mes = message + "I LOVE STUDY 0962135 qusufeiyuezuo"
加上一段字符串{:5_104:}
3.然后大家要在保存的地方建一个txt,叫1,里面打上2
因为如果你设置密码
那里面要变成1
一开始要检测的
感谢!
页:
[1]