TclError:无法调用“ pack”命令:应用程序已被破坏

时间:2019-03-23 03:09:12

标签: python tkinter

在关闭下面的程序时出错 每当有人试图关闭应用程序窗口时,终端出现错误无法调用“ pack”命令:应用程序已被破坏

from tkinter import *
from time import *
from collections import deque
from os import remove

root=Tk()
root.geometry("900x500")
root.title('Encryption and Decryption')
frame=Canvas(root)
frame.pack()
frame1=Canvas(root)
frame1.pack(side=TOP)
frame2=Canvas(root)
frame2.pack(side=TOP)
frame3=Canvas(root)
frame3.pack(side=TOP)

file=deque([])
file1=deque([])
filek=deque([])
name=deque([])

giflist=[]
for image in imagelist:
    photo=PhotoImage(file=image)
    giflist.append(photo)
l4=Label(frame1,bd=0)
l0=Label(frame,font=("arial",30,"italic"))
l=Label(frame,text='Welcome Mr. Oberoi',fg="Green",font=("arial",50,'italic'))
l1=Label(frame,text="You can encrypt and decrypt text",fg="black",font=("times",35,'bold'))
l2=Label(frame,text="Baljeet Oberoi",fg="blue",font=("times",35,'italic'))
l3=Label(frame,text=" ",fg="blue",font=("times",35,'italic'))

while True:
        for gif in giflist:
            l.pack()
            l1.pack()
            l2.pack()
            l3.pack(side=RIGHT)
            sleep(0.1)
            l4.pack()
            frame.update()
root.mainloop()

0 个答案:

没有答案