add image togui
This commit is contained in:
parent
0b7130d4e6
commit
3ea7891753
16
chaineTV.py
16
chaineTV.py
@ -1,4 +1,3 @@
|
||||
from tkinter import Label,Button,Frame,Tk,Entry,StringVar,LEFT,RIGHT
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
@ -6,7 +5,12 @@ import unicodedata
|
||||
import webbrowser
|
||||
import urllib.request
|
||||
import re
|
||||
import io
|
||||
from PIL import Image,ImageTk
|
||||
from bs4 import BeautifulSoup
|
||||
from tkinter import Label,Button,Frame,Tk,Entry,StringVar,LEFT,RIGHT,PhotoImage,Image
|
||||
|
||||
|
||||
|
||||
class Labbelink (Label):
|
||||
|
||||
@ -65,17 +69,21 @@ class Interface:
|
||||
print(self.data[self.value.get()])
|
||||
self.resultframe.update()
|
||||
emision=parse_emmission(strlink)
|
||||
|
||||
if emision:
|
||||
if emision == "can't find show":
|
||||
Label(self.resultframe,text="impssible de parser cette chaine").pack()
|
||||
else:
|
||||
raw_data = urllib.request.urlopen(emision['img']).read()
|
||||
image = ImageTk.PhotoImage(file=io.BytesIO(raw_data))
|
||||
photolabel=Label(self.resultframe,image=image)
|
||||
photolabel.image = image
|
||||
photolabel.pack()
|
||||
Labbelink(self.resultframe,("emmision ce soir: "+emision["title"]),emision['href']).pack()
|
||||
if len(emision['casting']) > 0:
|
||||
Label(self.resultframe,text="réalisateur: "+emision['casting'][0]).pack()
|
||||
Label(self.resultframe,text="acteur: "+str(emision['casting'][1:])).pack()
|
||||
Label(self.resultframe,text="synopsys: " +emision['synopsis'],wraplength=350).pack()
|
||||
|
||||
|
||||
Label(self.resultframe,text="synopsys: " +emision['synopsis'],wraplength=350).pack()
|
||||
else:
|
||||
Label(self.resultframe,text="pas de connection internet impossible de determiner l'émission du soir").pack()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user