from tkinter import*
from random import randint
root = Tk()
root.title('Clicker')
root.geometry('900x600')
root.resizable(False, False)
img = PhotoImage(file='')
lbl = Label(root, image=img)
coord_x = randint(0, 29) * 30
coord_y = randint(0, 19) * 30
lbl.place(x=coord_x, y=coord_y)
root.mainloop()
Answers & Comments
from tkinter import Tk, Label, PhotoImage
from random import randint
def on_click(event):
global coord_x, coord_y
coord_x = randint(0, 29) * 30
coord_y = randint(0, 19) * 30
lbl.place(x=coord_x, y=coord_y)
root = Tk()
root.title('Clicker')
root.geometry('900x600')
root.resizable(False, False)
img = PhotoImage(file='path_to_your_image.png')
lbl = Label(root, image=img)
lbl.bind('<Button-1>', on_click)
coord_x = randint(0, 29) * 30
coord_y = randint(0, 19) * 30
lbl.place(x=coord_x, y=coord_y)
root.mainloop()