Skip to content

Commit dc9dca1

Browse files
authored
Add files via upload
1 parent c4eb24c commit dc9dca1

6 files changed

+160
-0
lines changed

0先看看我!使用说明.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
蜜蜂姐定制版番茄钟:
2+
0.推荐使用【Prism简易番茄钟_40%不透明度.exe】
3+
1.点开.exe 就能使用了 无需安装的
4+
2.如果想要在桌面可以点击进去 请右键软件创建快捷方式(右键-发送到-桌面快捷方式)
5+
(因为提示音文件要和exe一起 不然就没了结束时候的提示音了,反之不喜欢提示音直接把tisimusic.wav删掉即可。PS:就算没有提示音也有弹窗的系统提示音,不喜欢可以改的)
6+
3.软件名字都可以随便重命名,决定用哪一个版本之后可以把其他版本删掉了
7+
8+
按键说明:
9+
1.软件使用 点击‘25分’,会开始倒计时,结束会有提示音和弹窗,番茄个数会+1(彻底完成才+1)。点击‘5分’,就是5分钟倒计时,同样会有提示。
10+
2.‘清除’按键是用来清除番茄总个数的,每一件任务全部完成了才点击清除。

1番茄工作法使用说明.txt

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
番茄工作法是简单易行的时间管理方法.
2+
使用番茄工作法,选择一个待完成的任务,将番茄时间设为25分钟,专注工作,中途不允许做任何与该任务无关的事,直到番茄时钟响起,然后在纸上画一个X短暂休息一下(5分钟就行),每4个番茄时段多休息一会儿。
3+
4+
通俗易懂:
5+
开始番茄之后的25分钟要完全专注。时间一到就放松5分钟。
6+
每4个番茄休息25分钟(这个看个人)
7+
关键:Excel拉出一个表格,一行是任务,一行是番茄个数,每一天开始工作前,把今天要完成的任务全部列出来,然后开始逐个执行(一个个番茄时间)。任务完成统计所用番茄数(软件会统计番茄,整个任务完成点一下“清除”即可将番茄数归零)。日积月累下来,就能通过以往来估计自己当前任务需要多少番茄(时间),便于时间的分配安排。
8+
9+
up主分享番茄学习法视频:https://www.bilibili.com/video/av90137130
10+
如何通过25分钟提高学习效率? I 番茄学习法的分享↑
11+

main.py

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# 番茄钟简易tk版本 prism
2+
# 说明time.sleep()不能太长 否则无响应==
3+
# -*- coding: UTF-8 -*-
4+
5+
import tkinter as tk # 模块重命名
6+
import tkinter.font as tkFont #字体模块重命名
7+
import tkinter.messagebox #提示弹窗模块重命名
8+
import time#时间模块
9+
import winsound#声音模块只能播放.wav
10+
import math#数字处理模块 用于了向上取余
11+
# 创建主窗体
12+
window = tk.Tk()
13+
# 进入消息循环
14+
window.wm_attributes('-topmost',1)#窗口置顶
15+
window.attributes("-alpha",0.4)
16+
window.title('Prism番茄钟') # 设置窗口名字
17+
window.geometry('195x150') # 设置窗口大小
18+
cheak=0
19+
def clean_line(): #清除进度条
20+
global cheak
21+
cheak =0
22+
fill_line = canvas.create_rectangle(1, 1, 0, 23, width=0, fill="white")
23+
canvas.coords(fill_line, (0, 0, 200, 60))#括号内第三个删除是关键
24+
window.update()#更新窗口
25+
26+
def count_deep25():#25分钟倒计时
27+
global fre#声明使用全局变量 global是全局变量更改的函数
28+
global var
29+
global x
30+
global n
31+
clean_line()#清理进度条
32+
x=0.1#细分了全长150 0.1*60*25
33+
n=0#进度条累加的变量
34+
fill_line = canvas.create_rectangle(1, 1, 0, 23, width=0, fill="green")#声明下面增加进度条的颜色,绘制矩形((a,b,c,d),值为左上角和右下角的坐标);
35+
var=25#倒计时25分钟
36+
canvas.coords(fill_line, (0, 0, 75, 60))
37+
L3['text']=str(var)#初始化页面的倒计时 例如00 → 25
38+
L3.update()#更新该项数值
39+
while var>0:#当大于0进入循环
40+
time.sleep(1)#延时1秒 测试时候设置0.1快进10倍
41+
var = var-(1/60)#一分钟的1/60
42+
n=n+x#进度条累加
43+
canvas.coords(fill_line,(0,0,n,60))#进度条延长?coords(ID) 返回对象的位置的两个坐标(4个数字元组);
44+
window.update()#更新全局
45+
try:
46+
if var <= 9:#始终保持两位数 小于就前面补0
47+
L3['text'] =str(0)+str(math.ceil(var))#前面补0 # math.ceil作用是向上取整 0.99→1
48+
L3.update()
49+
if var < 1:
50+
cheak=1
51+
else:
52+
L3['text']=str(math.ceil(var))
53+
L3.update()
54+
except:
55+
break
56+
fre = fre+1#番茄个数加一
57+
L2['text']=str(fre)#调用相关的初始化值
58+
L2.update()
59+
if cheak == 1:
60+
winsound.PlaySound("tisimusic.wav", flags=1)#播放音乐
61+
tk.messagebox.showinfo('Prism提醒', '请休息一下吧!')#弹窗提示
62+
63+
64+
def count_deep5():#倒计时5分钟 原理同上 改进写法 同一个函数写完即可 通过不同按钮提供不同的标志位加以判断即可
65+
global fre
66+
global var
67+
global x
68+
global n
69+
global cheak
70+
clean_line()
71+
x=0.5# 划分进度条 0.5*60*5分钟
72+
n=0
73+
fill_line = canvas.create_rectangle(1, 1, 0, 23, width=0, fill="green")
74+
var=5
75+
canvas.coords(fill_line, (0, 0, 75, 60))
76+
L3['text']="0"+str(var)
77+
L3.update()
78+
while var>0:
79+
time.sleep(1)
80+
var = var-(1/60)
81+
n=n+x
82+
canvas.coords(fill_line,(0,0,n,60))
83+
window.update()
84+
try:
85+
if var <=9:
86+
L3['text'] =str(0)+str(math.ceil(var))
87+
L3.update()
88+
if var < 1:
89+
cheak=1
90+
else:
91+
L3['text']=str(math.ceil(var))
92+
L3.update()
93+
except:
94+
break
95+
if cheak ==1:
96+
winsound.PlaySound("tisimusic.wav",flags =1)
97+
tk.messagebox.showinfo('Prism提醒', '休息时间结束')
98+
99+
def clean_fre():#清理按键 清理番茄个数的累计
100+
global fre
101+
fre=0#将其归0
102+
L2['text']=str(fre)
103+
L2.update()
104+
105+
106+
107+
# 设置文字
108+
L1 = tk.Label(window,text='当前任务番茄个数: ')
109+
L1.grid(row=1,column=1)
110+
fre=0 # 番茄钟个数
111+
underline = 1
112+
ft1 = tkFont.Font(underline=1)
113+
L2 = tk.Label(window,text=str(fre),font = ft1)
114+
L2.grid(row=1, column=2)
115+
var=25 # 倒计时数字
116+
ft = tkFont.Font(size=60)
117+
L3 = tk.Label(window,text=str(var), font=ft)
118+
L3.place(x=55,y=20)#直接使用坐标定位
119+
120+
#设置进度条
121+
canvas = tk.Canvas(window, width=149, height=10, bg="white") #width 因为长了一点-1不美观 150-1=149
122+
canvas.place(x=20,y=98)
123+
# def progress():
124+
# fill_line = canvas.create_rectangle(1.5, 1.5, 0, 23, width=0, fill="green")
125+
# x = 500
126+
# n = 465 / x
127+
# canvas.coords(fill_line,(0,0,n,60))
128+
# window.update()
129+
# time.sleep(0.02)
130+
131+
T25=tk.Button(window, text='25分', command=count_deep25)#按键设置
132+
T25.place(x=20,y=115)
133+
T05=tk.Button(window, text='05分', command=count_deep5)
134+
T05.place(x=80,y=115)
135+
clean=tk.Button(window, text='清零', command=clean_fre)
136+
clean.place(x=139,y=115)
137+
138+
139+
window.mainloop()#无限循环

mx.ico

66.1 KB
Binary file not shown.

tisimusic.wav

1.57 MB
Binary file not shown.

番茄钟Prism.exe

7.86 MB
Binary file not shown.

0 commit comments

Comments
 (0)