Ошибка:
Traceback (most recent call last):
File "C:\Users\Asus\Desktop\Програмирование\Tkinter\Приложение\main.py", line 2, in <module>
from PIL import ImageTk
File "C:\Users\Asus\AppData\Local\Programs\Python\Python311\Lib\site-packages\PIL\ImageTk.py", line 31, in <module>
from . import Image
File "C:\Users\Asus\AppData\Local\Programs\Python\Python311\Lib\site-packages\PIL\Image.py", line 36, in <module>
import tempfile
File "C:\Users\Asus\AppData\Local\Programs\Python\Python311\Lib\tempfile.py", line 45, in <module>
from random import Random as _Random
File "C:\Users\Asus\Desktop\Програмирование\random.py", line 7, in <module>
num=random()*8
^^^^^^^^
TypeError: 'module' object is not callable
А вот сам код:
from tkinter import *
from PIL import ImageTk
root=Tk()
root.geometry("600x800")
im=ImageTk.PhotoImage(file="Fortnite_S1.png")
btn=Button(root, image=im, height=5, width=4)
btn.grid
root.mainloop()
random.py