Grid made by Label and Entry

Submitted by:Jhon Smith

Date added:11 October, 2012

Category:Python

Python code example for Grid made by Label and Entry

Tags: grid

Code Snippet:

from Tkinter import *
colors = ['red', 'green', 'orange', 'white', 'yellow', 'blue']

r = 0
for c in colors:
Label(text=c, relief=RIDGE, width=25).grid(row=r, column=0)
Entry(bg=c, relief=SUNKEN, width=50).grid(row=r, column=1)
r = r+1

mainloop()
 
 

Comments