Answer the question
In order to leave comments, you need to log in
TypeError: move() takes 0 positional arguments but 1 was given how to solve?
Hello, I get this error in the TypeError code: move() takes 0 positional arguments but 1 was given I wanted to make a program in which the button would change its position when hovering over it, but the problem got out
here Code:
from tkinter import *
import random
root=Tk( )
root.title("KnOpKa")
root.geometry('400x400')
def move():
x = random.randint(0,180)
y = random.randint(0,200)
b1.pack(padx=x, pady=y)
b1=Button(root, text="gg",command=move)
b1.pack(padx=100, pady=180)
b1.bind("", move)
b1.bind('', move)
root.mainloop( )
Answer the question
In order to leave comments, you need to log in
Your problem is googled at times.
bind example
Your move function must have an argument.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question