On 8/9/06, Alan Gauld <[EMAIL PROTECTED]> wrote:
Linda,
> Is that possible to open two Tkinter from one python shell?
Tkinter is a python module. You can't really open a Tkinter,
you can only import the module. What you can do is write
a Tkinter application with multiple windows.
You can have as many Tkinter applications running as
you like but they will all be separate processes.
Can you be clearer about what exactly you want to do?
Alan G.
I want to open two windows with one having the blue triangle and the
other one having the red triangle (the code is attached). I can not
figure out how to use toplevel.
Linda
from Tkinter import *
root = Tk()
canW=800
canH=600
can = Canvas(root,bg="white",width=canW,height=canH)
can.pack()
points1=((100,100),(300,400),(400,100))
for pp in points1:
x = pp[0]
y = pp[1]
can.create_oval(x-4,y-4,x+4,y+4,fill='red')
segs1=(((100,100),(300,400)),((100,100),(400,100)),((300,400),(400,100)))
for seg in segs1:
x1 = seg[0][0]
y1 = seg[0][1]
x2 = seg[1][0]
y2 = seg[1][1]
can.create_line(x1,y1,x2,y2,fill='blue')
#root.mainloop()
points2=((50,400),(400,200),(300,200))
for pp in points2:
x = pp[0]
y = pp[1]
can.create_oval(x-4,y-4,x+4,y+4,fill='blue')
segs2=(((50,400),(400,200)),((50,400),(300,200)),((400,200),(300,200)))
for seg in segs2:
x1 = seg[0][0]
y1 = seg[0][1]
x2 = seg[1][0]
y2 = seg[1][1]
can.create_line(x1,y1,x2,y2,fill='red')
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor