[Tutor] number guessing game

Treloar, Nick Nick.Treloar at education.nsw.gov.au
Wed May 9 06:50:48 CEST 2007


here is my code so far
from Tkinter import*
root = Tk()
root.title("main screen")
root.maxsize(width=350,height=200)
root.minsize(width=350,height=200)
root.resizable(width=YES,height=YES)

def child1():
    c1 = Toplevel(root)
    c1.guess_ent = Entry(c1, width = 35,)
    c1.guess_ent.grid(row = 14, column = 0)
    c1.box_txt = Text(c1, width = 35, height = 5, wrap = WORD)
    c1.box_txt.grid(row = 3, column = 0, columnspan=2) 
    c1.title("easy")
    c1.geometry("200x200")
    Button(c1,text="clear").grid(row=1,column=0)
    Button(c1,text="new game",).grid(row=1,column=1)
def child2():
    c2 = Toplevel(root)
    box_txt = Text(c2, width = 35, height = 5, wrap = WORD)
    box_txt.grid(row = 3, column = 0, columnspan=2,sticky = W) 
    c2.title("medium")
    c2.geometry("200x200")
def child3():
    c3 = Toplevel(root)
    box_txt = Text(c3, width = 35, height = 5, wrap = WORD)
    box_txt.grid(row = 3, column = 0, columnspan=2,sticky = W) 
    c3.title("hard")
    c3.geometry("200x200")

Label(root,text = "choose which game you would like to play").grid(row=0,column=0,columnspan=2)
Button(root,text="easy",command=child1).grid(row=1,column=0)
Button(root,text="medium",command=child2).grid(row=1,column=1)
Button(root,text="hard",command=child3).grid(row=1,column=3)
 

This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070509/c54cae4f/attachment.htm 


More information about the Tutor mailing list