Load image to label : Label « GUI Tk « Python






Load image to label

 
from Tkinter import *

root = Tk()
#root.option_readfile('optionDB')
root.title('Labels')
Label(root, text="Text ", wraplength=300, justify=LEFT).pack(pady=10)
f1=Frame(root)
Label(f1, text="Text", relief=RAISED).pack(side=LEFT, padx=5)
Label(f1, text="Text", relief=SUNKEN).pack(side=LEFT, padx=5)
f1.pack()
f2=Frame(root)
for bitmap,rlf  in [('woman', RAISED),('mensetmanus',SOLID),('terminal',SUNKEN),
               ('escherknot',FLAT),('calculator',GROOVE),('letters',RIDGE)]:
    Label(f2, bitmap='@bitmaps/%s' % bitmap, relief=rlf).pack(side=LEFT, padx=5)
f2.pack()
root.mainloop()



           
         
  








Related examples in the same category

1.A label and a buttonA label and a button
2.Basic coding styles with labelsBasic coding styles with labels
3.Set side to topSet side to top
4.Add a label to a frameAdd a label to a frame
5.Label wraplength
6.Set text and font for Label
7.Label styleLabel style
8.Label on frameLabel on frame
9.Label border: RAISED, SUNKEN, FLAT, RIDGE, GROOVE, SOLIDLabel border: RAISED, SUNKEN, FLAT, RIDGE, GROOVE, SOLID
10.Our First Tkinter Program: a label and a windowOur First Tkinter Program: a label and a window
11.Simplest LabelSimplest Label
12.Label background and foregroundLabel background and foreground
13.StringVar and Label variable
14.Bind variable to Label
15.Label width and heightLabel width and height