The code (1)

#!/usr/bin/env python
from Tkinter import *
import math

root = Tk()               # root (main) window
top = Frame(root)         # create frame (good habit)
top.pack(side='top')      # pack frame in main window

hwtext = Label(top, text='Hello, World! The sine of')
hwtext.pack(side='left')

r = StringVar()  # special variable to be attached to widgets
r.set('1.2')     # default value
r_entry = Entry(top, width=6, relief='sunken', textvariable=r)
r_entry.pack(side='left')

previousnexttable of contents