{"id":14277,"url":"\/distributions\/14277\/click?bit=1&hash=17ce698c744183890278e5e72fb5473eaa8dd0a28fac1d357bd91d8537b18c22","title":"\u041e\u0446\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u0442\u0440\u044b \u0431\u0435\u043d\u0437\u0438\u043d\u0430 \u0438\u043b\u0438 \u0437\u043e\u043b\u043e\u0442\u044b\u0435 \u0443\u043a\u0440\u0430\u0448\u0435\u043d\u0438\u044f","buttonText":"\u041a\u0430\u043a?","imageUuid":"771ad34a-9f50-5b0b-bc84-204d36a20025"}

from tkinter import *

root=Tk() root.geometry('400x400')

def btn1(): label2 = Label(text = "Hello "+ ent.get()+'!') label2.place(x=150, y=150) canvas.create_image(100, 0, anchor = NW, image = fl_img)

button1 = Button(text = "Hello", command = btn1) button1.place(x=75,y=75, width=100, height=50)

button2 = Button(text = "Exit", command = root.destroy) button2.place(x=225,y=75, width=100, height=50)

ent = Entry(bd=1) ent.place(x=225,y=25, width=100, height=30)

label1 = Label(text = "Enter your name:") label1.place(x=75, y=25, width=100, height=30)

canvas = Canvas(width = 500, height = 500) canvas.place(x=0, y=200) fl_img = PhotoImage(file = "flowers.png")

root.mainloop()

0
Комментарии
-3 комментариев
Раскрывать всегда