第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Tkinter GUI 不顯示任何內(nèi)容

Tkinter GUI 不顯示任何內(nèi)容

繁華開滿天機(jī) 2022-06-14 17:52:06
我正在將 GUI 改裝到我制作的用于管理屏幕截圖的 CLI 工具上。每當(dāng)我運(yùn)行該文件時(shí),盡管對代碼進(jìn)行了三次檢查,但沒有出現(xiàn)任何 GUI。我嘗試重構(gòu)并尋找永不中斷的循環(huán),但我沒有找到任何東西。我還將我的代碼與 Tkinter 上的一些教程進(jìn)行了比較,沒有發(fā)現(xiàn)任何問題。這是代碼:import os, time, shutilfrom tkinter import *class App:    def __init__(self, root):        self.root = root        self.path_to_watch = "" # set to wherever your screenshots save by default        self.new_dir = "" # set to where you want files moved to        # create widgets        path_box = Entry(root)        path_box.pack()        new_dir_box = Entry(root)        new_dir_box.pack()        # continuously fetch input        while True:            try:                path_to_watch = path_box.get()                new_dir = new_dir_box.get()            except Exception:                pass        # create button that executes the clean        b = Button(root, text="Clean", command=move_file())        b.pack()    def move_file(self):        directory = os.listdir(path_to_watch)        words = ['Screen','Shot','Screenshot'] # keywords for default OSX Screenshots        for i in directory:            src = path_to_watch + i            new_dir_filename = new_dir + i             filename = i.split()            for w in filename:                if w in words:                    if os.path.isdir(new_dir):                         shutil.move(src, new_dir_filename)                        break                    else:                        os.mkdir(new_dir)                        shutil.move(src, new_dir_filename)                        breakif __name__ == '__main__':    root = Tk()    AppGUI = App(root)    AppGUI.pack()    root.mainloop()我希望它在運(yùn)行時(shí)構(gòu)建一個(gè) GUI,但沒有任何反應(yīng)。
查看完整描述

1 回答

?
慕妹3242003

TA貢獻(xiàn)1824條經(jīng)驗(yàn) 獲得超6個(gè)贊

while True:循環(huán)沒有中斷。



查看完整回答
反對 回復(fù) 2022-06-14
  • 1 回答
  • 0 關(guān)注
  • 191 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號