Виправити код згідно зразка щоб запрацювало Python
from tkitner import *
from tkinter import messagebox
window = Tk
window.geometry('400x300'
window.title 'Практична робота 12')
def start_buton6(event):
btn1 = Button(window, text = 'Red', width = 20, height = 2 )
btn1.place(x = 210, y = 100)
btn1.bind("", start_buton1)
btn2 = Button(window, text = 'Green', width = 20, height = 2 )
btn2.place(x = 210, y = 100)
btn2.bind("", start_buton2)
btn3 = Button(window, text = 'yellow', width = 20, height = 2 )
btn3.place(x = 40, y = 200)
btn3.bind("", start_buton3)
btn4 = Button(window, text = 'Black', width = 20, height = 2 )
btn4.place(x = 210, y = 200)
btn4.bind("", start_buton4)
def start_buton1(event)
window["bg"]="yellow"
start = Label(window, text = 'Зміни колір вікна ', bg = 'red',width = 20, height = 2)
start.place(x = 130, y = 50)
def start_buton2(event):
window["bg"]="lime"
start = Label(window, text = 'Зміни колір вікна ', bg = 'lime',width = 20, height = 2)
start.place(x = 130, z = 50)
daf start_buton3(event):
window["bg"]="blue"
start = Label(window, text = 'Зміни колір вікна ', bg = 'blue,width = 20, height = 2)
start.place(x = 130, y = 50)
def start_buton4(event):
window["bg"]="black"
start = Label(window, text = 'Зміни колір вікна ', bg = 'black',width = 20, height = 2)
start.place(x = 130, y = 50)
Start = Labe1(window, text = 'Зміни колір вікна ',width = 20, height = 2)
start.place(x = 130, y = 50)
btn5 = Button(window, text = 'Start', width = 20, height = 2 )
btn5.place(x = 125, y = 150)
btn5.bind("", start_buton5)
window.mainlop()
Ответы
Ответ:
from tkinter import *
from tkinter import messagebox
from tkinter import ttk
window = Tk()
window.geometry('400x300')
window.title('Практична робота 12')
def start_buton6(event):
btn1 = Button(window, text = 'Red', width = 20, height = 2 )
btn1.place(x = 210, y = 100)
btn1.bind("", start_buton1)
btn2 = Button(window, text = 'Green', width = 20, height = 2 )
btn2.place(x = 210, y = 100)
btn2.bind("", start_buton2)
btn3 = Button(window, text = 'yellow', width = 20, height = 2 )
btn3.place(x = 40, y = 200)
btn3.bind("", start_buton3)
btn4 = Button(window, text = 'Black', width = 20, height = 2 )
btn4.place(x = 210, y = 200)
btn4.bind("", start_buton4)
def start_buton1(event):
window["bg"]="yellow"
start = Label(window, text = 'Зміни колір вікна ', bg = 'red',width = 20, height = 2)
start.place(x = 130, y = 50)
def start_buton2(event):
window["bg"]="lime"
start = Label(window, text = 'Зміни колір вікна ', bg = 'lime',width = 20, height = 2)
start.place(x = 130, z = 50)
def start_buton3(event):
window["bg"]="blue"
start = Label(window, text = 'Зміни колір вікна ', bg = 'blue,width = 20', height = 2)
start.place(x = 130, y = 50)
def start_buton4(event):
window["bg"]="black"
start = Label(window, text = 'Зміни колір вікна ', bg = 'black',width = 20, height = 2)
start.place(x = 130, y = 50)
Start = Label(window, text = 'Зміни колір вікна ',width = 20, height = 2)
Start.place(x = 130, y = 50)
btn5 = Button(window, text = 'Start', width = 20, height = 2 )
btn5.place(x = 125, y = 150)
btn5.bind("", start_buton1)
window.mainlop()
Объяснение: