'Python Tkinter use iconbitmap without needing a filepath (like a picture url)

i am trying to include a iconbitmap in my Tkinter project, but i want it to be a single .exe file. For that reason i dont want to use other files, that are needed (like in the same directory). My idea was, to just use an URL of a picture. What i found was that:

root.tk.call('wm', 'iconphoto', root._w, tk.PhotoImage(file="icon.png"))

How is it possible to use a URL instead? Or maybe there is a completely other way to store the icon, except as a seperate file.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source