Tkinter interactive

cm012b5105 cm012b5105 at blueyonder.co.uk
Sat Dec 17 06:30:42 EST 2005


Hello i am fairly new to python,
I have written an interactive programme a small example of it is here.
s = raw_input ("Do you have any children? ")
if s== 'yes':
   print "Thats great"
elif s=='no':
   print "Well my boss has 2"


Now i have also been looking at Tkinter if we take the basic "hello, world" 
programme which is like this.

# File: hello1.py

from Tkinter import *

root = Tk()

w = Label(root, text="Hello,!")
w.pack()

root.mainloop()

What i want is to incorporate this in to my programme so when i start my 
programme a little box appears saying hello then my interactive programme 
runs within the box
This it what it looks like

from Tkinter import *

root = Tk()

w = Label(root, text="Hello,!")
w.pack()
s = raw_input ("Do you have any children? ")
if s== 'yes':
   print "Thats great"
elif s=='no':
   print "Well my boss has 2"

The result of that is i just get another box open and start to run my 
interactive programme as though it ignores the Tk box which says hello hope 
this makes sense any advise on this please.
thanks nige



More information about the Python-list mailing list