Benjamin-Loison / cpython

The Python programming language
https://www.python.org/
Other
0 stars 0 forks source link

tkinter does not accept SVG #13

Open Benjamin-Loison opened 8 months ago

Benjamin-Loison commented 8 months ago
icon = tk.PhotoImage(file = 'icon.png')
root.wm_iconphoto(True, icon)

Source: Stack Overflow answer 64042079

Traceback (most recent call last):
  File "<tmp 1>", line 100, in <module>
    icon = tk.PhotoImage(file = 'icon.svg')
  File "/usr/lib/python3.10/tkinter/__init__.py", line 4103, in __init__
    Image.__init__(self, 'photo', name, cnf, master, **kw)
  File "/usr/lib/python3.10/tkinter/__init__.py", line 4048, in __init__
    self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't recognize data in image file "icon.svg"

Context: Benjamin_Loison/gnome-control-center#4.