国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

python2.7為什么點擊了"開始"按鈕后,tkinter上的按鈕,圖中紅色部分,再也點不動了?
漂亮男人
漂亮男人 2017-05-27 17:39:55
[Python討論組]

python2.7為什么點擊了"開始"按鈕后,tkinter上的按鈕,圖中紅色部分,再也點不動了?如何能在點擊"開始"按鈕后,還能點擊tkinter的最小化,最大化和關(guān)閉按鈕?
代碼為:

# -*- 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()

漂亮男人
漂亮男人

全部回復(1)
大家講道理

因為你在start里面寫的是死循環(huán),永遠不會結(jié)束
你應該新啟一個子線程才對

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板
關(guān)于我們 免責申明 意見反饋 講師合作 廣告合作 最新更新
php中文網(wǎng):公益在線php培訓,幫助PHP學習者快速成長!
關(guān)注服務號 技術(shù)交流群
PHP中文網(wǎng)訂閱號
每天精選資源文章推送
PHP中文網(wǎng)APP
隨時隨地碎片化學習
PHP中文網(wǎng)抖音號
發(fā)現(xiàn)有趣的

Copyright 2014-2025 http://m.miracleart.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號