鱼C论坛

 找回密码
 立即注册
查看: 1994|回复: 0

[作品展示] 用python写出的三个效率应用

[复制链接]
发表于 2020-8-11 20:14:05 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
通过2周的课余时间编写
终于将他们搞出来了!
我把这三个应用称为CityMorning Tools


第一个应用:TenCat密码记忆工具。
本应用基于对我前面发的账号密码工具
进行了部分的修改与升级

部分代码:
  1. #曲速飞跃作
  2. #请提前在保存此代码的地方创建1.txt

  3. import easygui as g

  4. a = open('1.txt')
  5. b = a.read()
  6. e = int(b)
  7. if e == 1:
  8.     d = g.enterbox('查看密码?')
  9.     h = int(d)
  10.     c = open('mimas.txt')
  11.     k = c.read()
  12.     f = int(k)
  13.     if h != f:
  14.         d = g.enterbox('再次输入查看密码?')
  15.         h = int(d)
  16.         c = open('mimas.txt')
  17.         k = c.read()
  18.         f = int(k)
  19.         if h != f:
  20.             exit(0)

  21. while True:
  22.     choices = g.buttonbox('主页',title = '密码工具',image = 'TenCat.jpg',choices = ('我的账号密码','增加账号密码','设置','退出'))

  23.     if choices == '增加账号密码':
  24.         msg = '增加'
  25.         title = '密码工具'
  26.         table = g.enterbox('平台?')
  27.         name = g.enterbox('账号?')
  28.         message = g.enterbox('密码?')
  29.         mes = message + "I LOVE STUDY 0962135 qusufeiyuezuo"

  30.         with open('pingtai.txt', 'a+') as f:
  31.             f.write(str(table))
  32.             f.write('\r\n')
  33.         with open('zhanghao.txt', 'a+') as f:
  34.             f.write(str(name))
  35.             f.write('\r\n')
  36.         with open('mima.txt', 'a+') as f:
  37.             f.write(str(mes))
  38.             f.write('\r\n')

  39.     elif choices == '我的账号密码':
  40.         a = open('pingtai.txt')
  41.         pt = a.read()
  42.         c = open('zhanghao.txt')
  43.         zh = c.read()
  44.         e = open('mima.txt')
  45.         message = e.read()
  46.         First = message
  47.         Second = "I LOVE STUDY 0962135 qusufeiyuezuo"
  48.         end = ""

  49.         for i in First:
  50.             if i in Second:
  51.                 First = First.replace(i, "")




  52.         g.msgbox('平台:' + pt + '账号:' + zh + '密码:' + First )

  53.     elif choices == '设置':
  54.         msg = '设置'
  55.         title = '密码工具'
  56.         choices = ['使用说明','删除账号密码','设置查看密码']
  57.         choices = g.choicebox(msg, title, choices)

  58.         if choices == '使用说明':
  59.             g.msgbox('这个工具用于帮助记不住密码的人。点击增加账号密码可增加,点击我的账号密码即可查询。在设置-设置查看密码 可以设置密码。')
  60.         elif choices == '删除账号密码':
  61.             g.msgbox('在此程序保存的位置找到pingtai.txt,zhanghao.txt,mima.txt,删除对应信息即可。')
  62.         elif choices == '设置查看密码':
  63.             mima = g.enterbox('密码?(数字)')
  64.             with open('mimas.txt', 'w') as f:
  65.                 f.write(str(mima))
  66.             with open('1.txt', 'w') as f:
  67.                 f.write(str(1))
  68.     elif choices == '退出':
  69.         exit(0)

  70.         

复制代码


请保存:
链接: https://pan.baidu.com/s/1zUOkK_m4hFXA7cXIwaz0ww
提取码: 9dky


第二个应用:DoIt待办事项
这是一个非常非常简单的待办应用
以后会慢慢完善的
部分代码:
  1. #曲速飞跃作

  2. import easygui as g
  3. import random

  4. a = open('1.txt')
  5. b = a.read()
  6. e = int(b)
  7. if e == 1:
  8.     d = g.enterbox('查看密码?')
  9.     h = int(d)
  10.     c = open('mimas.txt')
  11.     k = c.read()
  12.     f = int(k)
  13.     if h != f:
  14.         d = g.enterbox('再次输入查看密码?')
  15.         h = int(d)
  16.         c = open('mimas.txt')
  17.         k = c.read()
  18.         f = int(k)
  19.         if h != f:
  20.             exit(0)


  21. while True:
  22.     a = open("doit.txt")
  23.     b = a.read()
  24.     k = str(b)
  25.     se = random.randint(1, 5)
  26.     if se == 1:
  27.         ss = "\n\n\n\n\n书山有路勤为径,学海无涯苦作舟。"
  28.     elif se == 2:
  29.         ss = "\n\n\n\n\n读书破万卷,下笔如有神。"
  30.     elif se == 3:
  31.         ss = "\n\n\n\n\n少壮不努力,老大徒伤悲。"
  32.     elif se == 4:
  33.         ss = "\n\n\n\n\nI love study,study makes me happy!"
  34.     elif se == 5:
  35.         ss = "\n\n\n\n\n三更灯火五更鸡,正是男儿读书时。"
  36.     if k == "":
  37.         num = "任务都完成啦!" + ss
  38.     else:
  39.         num = "今日还有任务呢!加油鸭!" + ss
  40.     c = g.buttonbox(num + "\n\n\n\n\n",title="DoIt",image = "DoIt.jpg",choices=("我的待办","增加待办","设置","退出"))

  41.     if c == "增加待办":
  42.         enter = g.enterbox("待办名称?")
  43.         with open('doit.txt', 'a+') as f:
  44.             f.write(str(enter))
  45.             f.write('\r\n')
  46.         g.msgbox("设置成功!")
  47.     elif c == "我的待办":
  48.         a = open("doit.txt")
  49.         b = a.read()
  50.         c = str(b)
  51.         msg = c
  52.         title = "DoIt"
  53.         choice2 = ["我看到了","标记全部完成"]
  54.         c2 = g.buttonbox(msg,title,choice2)
  55.         if c2 == "我看到了":
  56.             g.msgbox("那还不赶快完成!?")
  57.         else:
  58.             with open('doit.txt', 'w') as f:
  59.                 f.write("")
  60.     elif c == "设置":
  61.         msg = "设置"
  62.         title = "DoIt"
  63.         choice3 = ["设置开始密码","更新信息"]
  64.         c3 = g.choicebox(msg,title,choice3)
  65.         if c3 == "设置开始密码":
  66.             mima = g.enterbox('密码?(数字)')
  67.             with open('mimas.txt', 'w') as f:
  68.                 f.write(str(mima))
  69.             with open('1.txt', 'w') as f:
  70.                 f.write(str(1))
  71.         else:
  72.             g.msgbox("该版本为1.0.0,为初始版本!")
  73.     elif c == "退出":
  74.         exit(0)
复制代码

请保存:
链接: https://pan.baidu.com/s/1fmOyVO7NzARZMcloPmmaNA
提取码: r63v


第三个应用:重头戏 TurtleTomato番茄工作法
一样的,很简陋,以后慢慢补充
部分代码:
  1. #曲速飞跃作

  2. import easygui as g
  3. import random
  4. import time
  5. from tkinter import *

  6. a = open('1.txt')
  7. b = a.read()
  8. e = int(b)
  9. if e == 1:
  10.     d = g.enterbox('查看密码?')
  11.     h = int(d)
  12.     c = open('mimas.txt')
  13.     k = c.read()
  14.     f = int(k)
  15.     if h != f:
  16.         d = g.enterbox('再次输入查看密码?')
  17.         h = int(d)
  18.         c = open('mimas.txt')
  19.         k = c.read()
  20.         f = int(k)
  21.         if h != f:
  22.             exit(0)

  23. while True:
  24.     se = random.randint(1, 5)
  25.     if se == 1:
  26.         ss = "\n\n\n\n\n书山有路勤为径,学海无涯苦作舟。"
  27.     elif se == 2:
  28.         ss = "\n\n\n\n\n读书破万卷,下笔如有神。"
  29.     elif se == 3:
  30.         ss = "\n\n\n\n\n少壮不努力,老大徒伤悲。"
  31.     elif se == 4:
  32.         ss = "\n\n\n\n\nI love study,study makes me happy!"
  33.     elif se == 5:
  34.         ss = "\n\n\n\n\n三更灯火五更鸡,正是男儿读书时。"

  35.     c1 = g.buttonbox("TurtleTomato  番茄工作法" + ss,title="TurtleTomato",image = "TurtleTomato.jpg",choices= ("开始番茄","番茄统计","历史记录","设置","退出"))
  36.     if c1 == "开始番茄":
  37.         do = g.enterbox("您要专注于?")
  38.         t = g.enterbox("时长?(一般25分钟)")
  39.         tt = int(t)
  40.         ttt = tt * 60

  41.         import pygame
  42.         import sys
  43.         from pygame.locals import *

  44.         pygame.mixer.init()

  45.         pygame.mixer.music.load("chanchanchan.ogg")
  46.         pygame.mixer.music.play()

  47.         for i in range(ttt + 1):
  48.             print(ttt - i)
  49.             time.sleep(1)
  50.         pygame.mixer.music.stop()
  51.         msg = "恭喜你完成专注(" + str(tt) + "分钟)!"
  52.         title = "TurtlrTomato"
  53.         choice = ["完成"]
  54.         c4 = g.buttonbox(msg,title,choice)
  55.         if c4 == "完成":
  56.             import datetime

  57.             nowTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
  58.             with open('history.txt', 'a+') as f:
  59.                 f.write(str(nowTime) + str(do) + str(tt) + "分钟")
  60.                 f.write('\r\n')
  61.             with open('time.txt','a+') as f:
  62.                 f.write("1")
  63.             msg = "是否休息?"
  64.             title = "TurtleTomato"
  65.             cho = ["是","否"]
  66.             c6 = g.buttonbox(msg,title,cho)
  67.             if c6 == "是":
  68.                 pygame.mixer.music.play()
  69.                 for i in range(301):
  70.                     print(301 - i)
  71.                     time.sleep(1)
  72.                 pygame.mixer.music.stop()

  73.                 g.msgbox("继续干起来!")


  74.     elif c1 == "历史记录":
  75.         a = open("history.txt")
  76.         b = a.read()
  77.         g.msgbox(b)

  78.     elif c1 == "退出":
  79.         exit(0)

  80.     elif c1 == "设置":
  81.         msg = "设置"
  82.         title = "TurtleTomato"
  83.         choice5 = ["设置开始密码","版本信息","番茄工作法"]
  84.         c5 = g.buttonbox(msg,title,choice5)
  85.         if c5 == "设置开始密码":
  86.             mima = g.enterbox('密码?(数字)')
  87.             with open('mimas.txt', 'w') as f:
  88.                 f.write(str(mima))
  89.             with open('1.txt', 'w') as f:
  90.                 f.write(str(1))

  91.         elif c5 == "版本信息":
  92.             g.msgbox("1.0.0")

  93.         elif c5 == "番茄工作法":
  94.             g.msgbox("番茄工作法是简单易行的时间管理方法.使用番茄工作法,选择一个待完成的任务,将番茄时间设为25分钟,专注工作,中途不允许做任何与该任务无关的事,直到番茄时钟响起,然后进行短暂休息一下(5分钟就行),然后再开始下一个番茄。每4个番茄时段多休息一会儿。番茄工作法极大地提高了工作的效率,还会有意想不到的成就感。")

  95.     elif c1 == "番茄统计":
  96.         a = open('time.txt')
  97.         b = a.read()
  98.         time = len(b)
  99.         g.msgbox("您一共专注了" + str(time) + "次!")
复制代码

请保存:
链接: https://pan.baidu.com/s/1SP5GTobGgG5ViFSz0ajNFA
提取码: j7jb



请多指教!!!
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-25 10:43

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表