[Tutor] were do i put the random number genorator
Treloar, Nick
Nick.Treloar at education.nsw.gov.au
Fri May 11 06:42:58 CEST 2007
i am tyin to make a number guesing game were do i put the random genorator it the top of each child screen def
here is my code
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", command = NIck).grid(row=1,column=0)
Button(c1,text="new game",).grid(row=1,column=1)
def NIck():
child1.box_txt.delete(0.0, END)
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/20070511/9c05414b/attachment.html
More information about the Tutor
mailing list