Answer the question
In order to leave comments, you need to log in
My program gives an error, how can I fix it?
from tkinter import *
from random import *
class Main:
def __init__(self):
global main_i
Main.frame=Tk()
main_i=True
Main.frame.geometry("600x600")
Main.img=PhotoImage(file="start.png")
Main.frame.title("mini-games by SAVT")
Main.frame["bg"]="black"
Main.start=Button(Main.frame,image=Main.img,command=Main.s)
Main.start.grid(row=0,column=0)
Main.exit_b=Button(Main.frame,text="Выход",command=Main.ex)
Main.exit_b.grid(row=1,column=0)
def ex():
Main.frame.destroy()
def s():
a=Choice()
class Choice:
def __init__(self):
global main_i
self.frame=Tk()
self.img=PhotoImage(file="ssp.png")
if main_i==True:
Main.frame.destroy()
self.frame.geometry("600x600")
self.frame.title("mini-games by SAVT")
self.frame["bg"]="black"
self.s_s_p_b=Button(self.frame,image=self.img)
self.s_s_p_b.grid(row=0,column=0)
class S_s_p:
pass
main_i=False
main=Main()
mainloop()
Error: Answer the question
In order to leave comments, you need to log in
'image “pyimage2” doesn't exist'?
Google is full of links to this error.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question