Jun-18-2020, 03:03 AM
This program fails too:
from tkinter import * image = PhotoImage(file='image.png')The error is
Output:Traceback (most recent call last):
File "C:\Users\djhys\Documents\python\musings\junk.py", line 3, in <module>
image = PhotoImage(file='image.png')
File "C:\Program Files\Python38\lib\tkinter\__init__.py", line 4061, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "C:\Program Files\Python38\lib\tkinter\__init__.py", line 3994, in __init__
raise RuntimeError('Too early to create image')
RuntimeError: Too early to create image
This program runsfrom tkinter import * Tk() image = PhotoImage(file='image.png')