Proberen om gif weer te geven
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
from tkinter import *
|
||||
from tkinter.font import Font
|
||||
import requests
|
||||
import urllib
|
||||
from PIL import Image
|
||||
|
||||
def get_rp():
|
||||
# Get API respons
|
||||
@@ -15,19 +17,19 @@ def get_rp():
|
||||
album = tekst["album"]
|
||||
year = tekst["year"]
|
||||
time = tekst["time"]
|
||||
# path = tekst["cover_med"]
|
||||
jpg_path = tekst["cover_med"]
|
||||
|
||||
# Return caller standard information
|
||||
message = (f'Titel: {title}\nArtiest: {artist}\nAlbum: {album}\nJaar: {year}\nTijd: {time}')
|
||||
return (message)
|
||||
return message,jpg_path
|
||||
|
||||
def rp_quit():
|
||||
exit()
|
||||
|
||||
def rp_refresh():
|
||||
rp_tekstbox.delete("1.0", "end")
|
||||
rp_tekstbox.insert("1.0", get_rp())
|
||||
|
||||
rp_tekstbox.insert("1.0", get_rp()[0])
|
||||
|
||||
if __name__=="__main__":
|
||||
|
||||
window=Tk()
|
||||
@@ -42,7 +44,20 @@ if __name__=="__main__":
|
||||
button_quit.pack(side=BOTTOM)
|
||||
button_refresh.pack(side=TOP)
|
||||
|
||||
rp_tekstbox.insert("1.0", get_rp())
|
||||
rp_tekstbox.insert("1.0", get_rp()[0])
|
||||
rp_tekstbox.pack()
|
||||
|
||||
# rp_image_path = get_rp()[1]
|
||||
# print(rp_image_path) ## DEBUG
|
||||
# rp_image_file = requests.get(rp_image_path).content
|
||||
# print(rp_image_file) ## DEBUG
|
||||
# rp_file=open("album_art.jpg", 'wb')
|
||||
# rp_file.write(rp_image_file)
|
||||
# rp_image = Image.open(rp_image_file)
|
||||
#rp_load = rp_image.load()
|
||||
#image_lbl = Label(window, image=rp_load)
|
||||
#image_lbl.pack()
|
||||
# rp_file.close()
|
||||
# rp_image.show()
|
||||
|
||||
window.mainloop()
|
||||
Reference in New Issue
Block a user