曲速飞跃 发表于 2020-7-31 09:52:03

用Python做一个密码工具

本帖最后由 曲速飞跃 于 2020-7-31 09:52 编辑

这是一个很简单的程序,我还做了4个小时呜呜呜

上代码!
#曲速飞跃作
#请提前在保存此代码的地方创建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.请提前在保存此代码的地方创建1.txt,因为你如果设置了查看密码,是要检测的
2.因为是密码工具,加密是必备的。这个程序的方法是个土方法。。。
mes = message + "I LOVE STUDY 0962135 qusufeiyuezuo"

3.此程序肯定有Bug,欢迎大家纠错!




曲速飞跃 发表于 2020-7-31 09:52:58

感谢!

liuzhengyuan 发表于 2020-7-31 09:52:58

else:
      pass可以省略不写

小甲鱼的铁粉 发表于 2020-7-31 10:38:43

{:10_275:}

曲速飞跃 发表于 2020-7-31 11:02:08

小甲鱼的铁粉 发表于 2020-7-31 10:38


谢!

weiter 发表于 2020-8-1 18:11:24

不做白嫖怪

还有苹果 发表于 2020-8-5 17:59:24

学习学习
页: [1]
查看完整版本: 用Python做一个密码工具