I am creating a simple tool to add album cover images to mp3 files in python. So far I am just working on sending a request to amazon with artist and album title, and get the resulting list, as well as finding the actual images for each result. What I want to do is to display a simple frame with a button/link for each image, and a skip/cancel button.
I have done some googling, but I can't find examples that I can use as a base.
All examples seems to focus on working on files on disk, rather with just a buffer. The TK documentation in the python standard library doesn't seem to cover the basic Button widget. This seems like an easy task, I have just not had any luck in finding the proper documentation yet.
you can modify this using urllib.urlopen()
. But I don't know (as I haven't tested it) if you can make this step without saving the (image) file locally. But IMHO urlopen
returns a file handle that is usable in tk.PhotoImage()
.
For jpg files in PhotoImage you need PIL:
from PIL import Image, ImageTk
image = Image.open("test.jpg")
photo = ImageTk.PhotoImage(image)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With