dato gracioso: estaba redactando la pregunta y solucione el error asi que active Responder a tu propia pregunta
Mi ventana envia dos ventanas
La idea era que mostrara "Bienvenido (Imagen) (Usuario)"
Y luego tenia que mostrar una entry y un boton para contraseña
Todo funcionaba perfecto, nada mal, sin errores.
No le agregue absolutamente NADA ni un espacio, NADA y de repente lo ejecuto
Todo bien hasta que salgo del programa por un momento y resulta que habia dos ventanas
Supuse que lo ejecute sin querer dos veces, lo cerre y volvi a abrir pero en vez de mostrar luego de "Bienvenido (Imagen) (Usuario)" luego tenia que poner un entry y en lugar de un boton se abria otra ventana con la misma imagen y me saltaba esto:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Maxi\AppData\Local\Programs\Python\Python38\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
File "C:\Users\Maxi\AppData\Local\Programs\Python\Python38\lib\tkinter\__init__.py", line 804, in callit
func(*args)
File "h:\bind.d\apps\enproceso\game_peter\os\main.py", line 55, in entry
from main import SadroImage
File "h:\bind.d\apps\enproceso\game_peter\os\main.py", line 50, in <module>
SadroImage=Label(root,image=SadroPhoto)
File "C:\Users\Maxi\AppData\Local\Programs\Python\Python38\lib\tkinter\__init__.py", line 3143, in __init__
Widget.__init__(self, master, 'label', cnf, kw)
File "C:\Users\Maxi\AppData\Local\Programs\Python\Python38\lib\tkinter\__init__.py", line 2567, in __init__
self.tk.call(
_tkinter.TclError: image "pyimage2" doesn't exist
Esto es lo mas importante del codigo Nombre del archivo main.py
def initializeroot():
global root
root=Tk()
skyblue="#0099FF"
blue="#0000FF"
root.attributes("-fullscreen",True)
global packWelcomeFrame_1
global welcomeFrame
global welcomeLabel
global welcomeLabel2
packWelcomeFrame_1=root.winfo_screenwidth() / 2 -200
packWelcomeFrame_3=root.winfo_screenwidth() / 2 -140
packWelcomeFrame_4=root.winfo_screenwidth() / 2 -140
packWelcomeFrame_2=root.winfo_screenheight() / 2
welcomeFrame=Frame(root,width=700,height=600,bg="blue")
welcomeFrame.place(relx=0.5, rely=0.5, anchor=CENTER)
welcomeLabel=Label(root,text="Bienvenido a",bg="blue")
welcomeLabel.place(x=packWelcomeFrame_3,y=200)
welcomeLabel.config(font=("Sans-Serif",36))
welcomeLabel2=Label(root,text=f"Usuario {username[0]}")
welcomeLabel2.place(x=packWelcomeFrame_4,y=500)
welcomeLabel2.config(font=("Sans-Serif",36),bg="blue")
def getPassword():
global passwordInput
passwordInput=passwordEntry.get()
global passwordResult
if passwordInput==password[0]:
passwordResult=True
else:
passwordResult=False-
readuserdata()
initializeroot()
SadroPhoto=PhotoImage(file="C:/ProgramData/sysadro/bin/sadro.sadroimage")
SadroImage=Label(root,image=SadroPhoto)
SadroImage.place(x=packWelcomeFrame_1,y=300)
def entry():
welcomeLabel.destroy()
welcomeLabel2.destroy()
from main import SadroImage
SadroImage.destroy()
global passwordEntry
global submitPassword
xvar=root.winfo_screenwidth() / 2 -50
xvar2=root.winfo_screenwidth() / 2 +125
passwordEntry=Entry(root,width=30,show="●")
passwordEntry.place(x=xvar,y=200)
submitPassword=Button(root,text="→",command=getPassword)
submitPassword.place(x=xvar2,y=200)
submitPassword.config(font=("Arial"))
root.after(3000,entry)