Tkinter dijital saat hatası

Merhabalar,kod şu şekilde

def zaman():
zaman_format = time.strftime("%H:%M:%S")
zmn_label.config(text=zaman_format)
zmn_label.after(200,zaman)

Bunlar başka bir fonksiyonun içinde
zmn_label=Label(duzenle,bg=‘white’,font=(“ds-digital”,50),background=“black”,foreground=“cyan”)
zmn_label.place(x=30,y=180)
zaman()

hatam ise şu şekilde:
invalid command name “1414922903488zaman”
while executing
“1414922903488zaman”
(“after” script)

merhabalar, bu tam olarak nedir? Sıkıntı burada başlıyor gibi.

Kodların tamamını atma imkanınız var mı? >> Bahsedildiği gibi

1 Beğeni

Buranın

window.after(200,zaman)

Olması gerekmiyor mu?
Window yerine oluşturduğunuz pencerenin adını yazın.

‘’'def zaman():

    zaman_format = time.strftime("%H:%M:%S")
    zmn_label.config(text=zaman_format)
    zmn_label.after(200,zaman)

def Duzenle(hastabilgisi,tckimlik):

        root.destroy()
        global duzenle
        duzenle=Tk()
        duzenle.geometry("720x700")
        lb1 = Label(duzenle,text="İstanbul Devlet Hastanemize Hoşgeldin", font="Times 20 italic")
        lb1.pack()
        global zmn_label



        image = Image.open('img_2.png')
        img = image.resize((300, 300))  # boyutlandırma
        resim = ImageTk.PhotoImage(img)
        label = Label(duzenle,image=resim, bg="Black")
        label.place(x=350, y=50)

        immag= Image.open('img_5.png')
        imgg= immag.resize((200,200))  # boyutlandırma
        resimm = ImageTk.PhotoImage(imgg)
        label = Label(duzenle, image=resimm)
        label.place(x=50, y=265)

        zmn_label=Label(duzenle,bg='white',font=("ds-digital",50),background="black",foreground="cyan")
        zmn_label.place(x=30,y=180)
        zaman()



        asistan=Button(duzenle,text="Sesli Asistan",bg='pink',fg='white',width=20,height=1,font=("Arial",18),activebackground='Blue',command=lambda:sesliAsistan)
        asistan.place(x=350,y=500)


        buton=Button(duzenle,text="Mevcut Randevuları Görüntüle",bg="Green",fg="White",width=25,height=3,command=lambda:RandevuListele())
        buton.place(x=300,y=370)
        buton1=Button(duzenle,text="Randevunu Görüntüle",bg="Green",fg="White",width=20,height=3,command=lambda:RandevunuListele(hastabilgisi))
        buton1.place(x=520,y=370)



        hava_buton=Button(text="Güncel Hava Durumu",bg="black",fg="white",font=("Arial",18),command=hava_Durumu)
        hava_buton.place(x=30,y=500)


        global x
        x=StringVar()

        Klinik=['Diyetisyen','Genel Cerrahi','KBB','Nöroloji','Psikiyatri','Dermatoloji','Fizyoloji','Dahiliye']

        diyetComb=Combobox(duzenle,text="",values=Klinik,height=3,textvariable=x,width=20,)
        diyetComb.place(x=50,y=70)

        buton = Button(duzenle, text="Seç", command=Test,width=10)
        buton.place(x=70,y=130)




        duzenle.mainloop()

‘’’

denedim ama olmadı :frowning:

Hayır. Widget’lerin de after metodu var.

1 Beğeni

Teşekkürler… aklım direkt fonksiyona gitti.

1 Beğeni

@Ozay11 Kodunuzun tamamını burada anlatıldığı şekilde paylaşın lütfen.