How do I always when the Down key is pressed and win +10? (Python3 + Tkinter)

0
from tkinter import *
from tkinter import messagebox
jan = Tk()
jan.geometry("500x500")

Quadrado = Frame(jan,bg="#B0C4DE", width=25, height=25, bd=3, relief="raise")
Quadrado.place(x=50, y=50)





def moveUp(event):
    print("Key Up")


jan.bind("<Up>", moveUp)
def moveDown(event):
    y = 60
    try_01 = 0
    try_01 = int(try_01)
    Quadrado.place(y=y)
    while try_01 <= 10:
        y += 10
        try_01 += 1





jan.bind("<Down>", moveDown)




jan.mainloop()
    
asked by anonymous 06.09.2018 / 03:28

1 answer

1
y = 10
def moveDown(event):
    global y
    try_01 = 0
    try_01 = int(try_01)
    Quadrado.place(y=y)
    while try_01 <= 10:
        y += 10
        try_01 += 1
    
04.10.2018 / 18:45