import tkinter
import random
root = tkinter.Tk()
root.geometry("400x200")
def randomNumber(max):
return round(random.random()*max)
class CreateButton:
def __int__(self,name,true):
self.button = tkinter.Button(root, text=name, height=30, width="50")
self.button.bind("Motion", printer())#не видит функцию принтер
def printer(self,event,true):
if(true==False):
self.button.place(x=randomNumber(400), y=randomNumber(200))
obj=CreateButton().__int__("ladno",False)
root.mainloop()