def change_but1():
but2['bg'] = '#ffffff'
but2['relief'] = tkinter.RAISED
but1['bg'] = '#eeeeee'
but1['relief'] = tkinter.SUNKEN
def change_but2():
but1['bg'] = '#ffffff'
but1['relief'] = tkinter.RAISED
but2['bg'] = '#eeeeee'
but2['relief'] = tkinter.SUNKEN
but1 = tkinter.Button(root, text = "Привет!", command=change_but1)
but1.config(bd = 1, font = ("Castellar", 25), bg = "white")
but1.place(x = 50, y = 160, height = 50, width = 150)
but2 = tkinter.Button(root, text = "Пока!", command=change_but2)
but2.config(bd = 1, font = ("Castellar", 25), bg = "white")
but2.place(x = 50, y = 220, height = 50, width = 150)
import numpy as np
z = np.fft.rfft(InputBuffer)[:2]
# Получаем постоянную состовл. амплитуду первой гарм., фазу первой гарм.
const_component = np.abs(z[0]) / 360
amplitude = np.abs(z[1]) / 180
phaze = np.angle(z[1])
while True:
n+=1
if n < 2:
create_ball()
for i in range(len(bub_id)):
a = bub_id[i].position()
x= a[0]
y= a[1]
dx = bub_spd[i][0]
dy = bub_spd[i][1]
if (x + dx) > 195 or (x+dx) < -195:
dx = -dx
if (y + dy) > 195 or (y + dy) < -195:
dy = -dy
#
bub_spd[i][0] = dx
bub_spd[i][1] = dy
#
bub_id[i].goto(x+dx,y+dy)
window.mainloop()