I am trying to insert an image(logo) in GIUs to display it in top left corner using grid and preferable in frame. When I do this code without demonstrator then it works perfectly but as soon I put it in Demonstrator the image disappears. Any Suggestion?
class TaskGUI():
def __init__(self,master):
header = Frame(master, )
header.grid(row=2,column=1,sticky=W)
canvas= Canvas(header, bg= 'pink')
Label(header, bg= 'blue' ).grid(row=1)
canvas.grid(row=1,column=1)
imgLogo = PhotoImage(file = 'logo.gif' )
canvas.create_image(10,10, image= imgLogo, ancho= NW)
if __name__ == "__main__":
top =Tk()
top.geometry('10920x1080')
top.title("Stel")
top.grid()
app = TaskGUI(top)
top.mainloop()
I tried to use PIL libary but could not find any solution on this on either, I get this error:
from PIL import Image,ImageTk
File "C:\Program Files\Python\PIL\Image.py", line 57
except ImportError, v:
^
SyntaxError: invalid syntax