pythontkinter使按钮失效_python2.7为什么点击了"开始"按钮后,tkinter上的按钮,图中红色部分,再也点不动了? - SegmentFault 思否...

python2.7为什么点击了"开始"按钮后,tkinter上的按钮,图中红色部分,再也点不动了?如何能在点击"开始"按钮后,还能点击tkinter的最小化,最大化和关闭按钮?

代码为:`# -- coding: UTF-8 --

from Tkinter import *

import os

import tkMessageBox

import time

root = Tk()

today_path = time.strftime('%Y-%m-%d')

work_path = 'C:\yes_pic\' + today_path

def start():while True:

doThis(work_path)

time.sleep(5)

def doThis(dirr):if not os.path.exists(dirr):

pass

else:

if os.path.isdir(dirr):

for p in os.listdir(dirr):

d = os.path.join(dirr,p)

if (os.path.isdir(d) == True):

doThis(d)

if os.listdir(dirr):

if dirr.count('\\')!=2:

tkMessageBox.showwarning("提示", "路径"+dirr+"有文件!")

button = Button(root, text="开始", command=start,width=20,height=10)

button.pack()

root.geometry('300x200+500+300')

root.mainloop()

`

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值