@client.event
async def on_чтототам(ctx):
x = 0
def calc(event):
global x
x = 0
root.after(0, one_iteration)
def one_iteration():
global x
x = randrange (1,10,1)
print("x=",x)
canv.delete("canvtext")
canv.create_text(50, 50, font=("Verdana", 20), text=str(x), anchor=CENTER, tags=('canvtext'))
if x != 5:
root.after(0, one_iteration)