Python眼睛护士改进版
添加了设定从(0,0)显示:self.root.geometry('1000x200+0+0')其实主要是两个0。那个1000和200是没用的,因为已经设定了minsize。
添加了窗口置顶:self.root.wm_attributes('-topmost',1)
1.主模块,设定时间
#-*-coding:utf--*-
import Tkinter,time,tkMessageBox,sys,BeBigModule
class MainFrame:
def __init__(self):
self.frame=Tkinter.Frame()
self.frame.pack() contentsWork=Tkinter.StringVar()
contentsRelax=Tkinter.StringVar() self.entryWorkWidget=Tkinter.Entry(self.frame,text=contentsWork)
contentsWork.set('input workTime here:')
self.entryWorkWidget["width"]= #这句话和下句话的先后顺序不会影响程序
self.entryWorkWidget.pack(side='top') self.entryRelaxWidget=Tkinter.Entry(self.frame,text=contentsRelax)
contentsRelax.set('input relaxTime here:')
self.entryRelaxWidget.config(width=)
self.entryRelaxWidget.pack(side='top') self.startButton=Tkinter.Button(self.frame,text="OK",command=self.start)
self.startButton.pack(side='left') self.quitButton=Tkinter.Button(self.frame,text="Exit",command=self.quit)
self.quitButton.pack(side='right')
self.frame.mainloop()
def start(self):
workTime=self.entryWorkWidget.get().strip()
workTimeNum=int(workTime)
# self.frame.deiconify()
# self.frame.withdraw
relaxTime=self.entryRelaxWidget.get().strip()
relaxTimeNum=int(relaxTime) self.frame.destroy()
beBigFrame=BeBigModule.BeBig(workTimeNum,relaxTimeNum) def quit(self):
pass
# root=Tkinter.Tk()
# root.title("CountDowm")
#
# mainFrame=MainFrame(root)
# root.mainloop()
mainFrame=MainFrame()
2.遮挡窗口:
import Tkinter,sys,time
class BeBig():
workTime=
relaxTime=
root=Tkinter.Tk()
Label1=Tkinter.Label(root,text=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())),compound = 'center',font=)
def __init__(self,workTimeNum,relaxTimeNum):
self.workTime=workTimeNum
self.relaxTime=relaxTimeNum
self.root.minsize(self.root.winfo_screenwidth(), self.root.winfo_screenheight())
#self.root.geometry('300x200-100-100')
self.root.config(bg='black')
self.root.wm_attributes('-topmost',)
self.root.geometry('1000x200+0+0') self.Label1.pack(side='top')
topTitle=self.root.winfo_toplevel()
topTitle.overrideredirect(True)
self.trickit(self.relaxTime,self.workTime)
self.root.mainloop()
def trickit(self,relaxTime,workTime):
for j in range(relaxTime,,-):
self.Label1["text"]=j
self.root.update()
time.sleep() self.root.withdraw()
time.sleep(workTime)
self.root.minsize(self.root.winfo_screenwidth(), self.root.winfo_screenheight())
self.root.update()
self.root.deiconify()
self.trickit(self.relaxTime,self.workTime)
#beBig=BeBig(,)
Python眼睛护士改进版的更多相关文章
- Python用Tkinter的Frame实现眼睛护士的倒计时黑色屏幕
import Tkinter,time class MyFrame(Tkinter.Frame): def __init__(self): Tkinter.Frame.__init__(self) s ...
- Python做的眼睛护士
搞了两天终于搞定了,虽然还存在一点点小问题(窗口的显示位置应该设在(0,0)).但基本可以用了. 代码分两个部分.主界面和遮挡屏幕界面.主界面设置完时间后调用遮挡屏幕界面. 1.主界面(设置 工作时间 ...
- python简单购物车改进版
# -*- coding: utf-8 -*- """ ┏┓ ┏┓ ┏┛┻━━━┛┻┓ ┃ ☃ ┃ ┃ ┳┛ ┗┳ ┃ ┃ ┻ ┃ ┗━┓ ┏━┛ ┃ ┗━━━┓ ┃ 神 ...
- 保护程序猿滴眼睛---修改VS 2012 编辑器颜色
转载于http://blog.csdn.net/qing666888/article/details/8973216 字体,发现好多人选用 Consolas ...确实挺好看的. 然后 修改背景色: ...
- 个人发现的createProcess调用漏洞
现在的杀毒软件都会杀掉c盘下的program.exe程序,所以某种意义上而言,这个漏洞算不上“漏洞”. 问题描述 眼睛护士版本:3.0.18.301存在createProcess调用漏洞. 详细说明 ...
- [python]计算机使用过程中,眼睛强制休息
前言 现在的电脑族们,在使用电脑的过程中,常常忘记了时间的流逝,要么忙碌在电视剧的观看中,要么忙碌在工作中,要么忙碌在游戏中,往往忽视了对眼睛的正常保护,让眼睛能够在空闲的时候获得足够的休息时间. 我 ...
- 接口自动化 基于python+Testlink+Jenkins实现的接口自动化测试框架[V2.0改进版]
基于python+Testlink+Jenkins实现的接口自动化测试框架[V2.0改进版] by:授客 QQ:1033553122 由于篇幅问题,,暂且采用网盘分享的形式: 下载地址: [授客] ...
- 接口自动化 基于python实现的http+json协议接口自动化测试框架源码(实用改进版)
基于python实现的http+json协议接口自动化测试框架(实用改进版) by:授客 QQ:1033553122 欢迎加入软件性能测试交流QQ群:7156436 目录 1. ...
- Python 基于python实现的http+json协议接口自动化测试框架源码(实用改进版)
目录 1. 写在前面 2. 开发环境 3. 大致流程 4. 框架简介 5. 运行结果展示 6. 文件与配置 7. 测试接口实例 n ...
随机推荐
- Tomcat 乱码设置
如果表单是以get方式提交就会出现中文乱码这时可以在tomcat中配置解决中文乱码问题. 方法如下:在tomcat的conf文件夹下的conf中找到server.xml文件 找到 Connector ...
- Android JNI 编译正确 但是提示程序有错误无法运行 而且还看不到任何错误提示 的解决方法
前几篇中一直在通过Android做JNI调用,关于JNI的配置请见:http://blog.csdn.net/watkinsong/article/details/9849973 但是前一段时间就遇到 ...
- JQuery - 点击,滚动回到顶部 / 底部刷新回到顶部
if ($(document).scrollTop() != 0) { //刷新之后,回到顶部 $('body,html').animate({ scrollTop: 0 }, 500); }
- JSP的学习(5)——语法知识三之include指令
本篇继续来对JSP语法中的JSP指令进行学习,在<JSP的学习(3)——语法知识二之page指令>中,已经介绍了JSP指令的书写格式和page指令的详细信息,所以在这一篇中我们会对JSP指 ...
- Taking Pictures Using FireMonkey Interfaces
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Taking_Pictures_Using_FireMonkey_Interfaces
- ListCtrl控件着色
最近在写一款山寨的反病毒软件,大致功能已经实现,还有一些细小的环节需要细化. 其中,在界面编程中,就用到了给ListCtrl控件着色,查看了网上一些文章,终于实现了. 其实说白了,原理很简单,就是Li ...
- c++ anonymous namespace -- 匿名空间
c++ anonymous namespace -- 匿名空间 匿名空间,匿名类,匿名联合体,匿名结构体. 匿名空间 #include <stdio.h> namespace A ...
- Test oracle db iops
Today, i need to test one database's iops and do something for oracle db's io test. How to test the ...
- Delphi的VMT的结构图,很清楚
Every Delphi class is defined internally by its vmt—its virtual-method table. The vmt contains a li ...
- Android面向HTTP协议发送get请求
/** * 採用get请求的方式 * * @param username * @param password * @return null表示求得的路径有问题,text返回请求得到的数据 */ pub ...