Proberen om gif weer te geven
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
@@ -3,6 +3,8 @@
|
|||||||
from tkinter import *
|
from tkinter import *
|
||||||
from tkinter.font import Font
|
from tkinter.font import Font
|
||||||
import requests
|
import requests
|
||||||
|
import urllib
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
def get_rp():
|
def get_rp():
|
||||||
# Get API respons
|
# Get API respons
|
||||||
@@ -15,18 +17,18 @@ def get_rp():
|
|||||||
album = tekst["album"]
|
album = tekst["album"]
|
||||||
year = tekst["year"]
|
year = tekst["year"]
|
||||||
time = tekst["time"]
|
time = tekst["time"]
|
||||||
# path = tekst["cover_med"]
|
jpg_path = tekst["cover_med"]
|
||||||
|
|
||||||
# Return caller standard information
|
# Return caller standard information
|
||||||
message = (f'Titel: {title}\nArtiest: {artist}\nAlbum: {album}\nJaar: {year}\nTijd: {time}')
|
message = (f'Titel: {title}\nArtiest: {artist}\nAlbum: {album}\nJaar: {year}\nTijd: {time}')
|
||||||
return (message)
|
return message,jpg_path
|
||||||
|
|
||||||
def rp_quit():
|
def rp_quit():
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
def rp_refresh():
|
def rp_refresh():
|
||||||
rp_tekstbox.delete("1.0", "end")
|
rp_tekstbox.delete("1.0", "end")
|
||||||
rp_tekstbox.insert("1.0", get_rp())
|
rp_tekstbox.insert("1.0", get_rp()[0])
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
|
|
||||||
@@ -42,7 +44,20 @@ if __name__=="__main__":
|
|||||||
button_quit.pack(side=BOTTOM)
|
button_quit.pack(side=BOTTOM)
|
||||||
button_refresh.pack(side=TOP)
|
button_refresh.pack(side=TOP)
|
||||||
|
|
||||||
rp_tekstbox.insert("1.0", get_rp())
|
rp_tekstbox.insert("1.0", get_rp()[0])
|
||||||
rp_tekstbox.pack()
|
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()
|
window.mainloop()
|
||||||
Reference in New Issue
Block a user