Python Forum
tkinter window and turtle window error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tkinter window and turtle window error
#3
from tkinter import *
import turtle

 
def circle(t,x,y):
    print("circle")
    t.down()
    t.color("#ff0000")
    for i in range (0,20):
        t.forward(10)
        t.rt(18)
         
def turtle1():
    try:
        turtle.TurtleScreen._RUNNING = True
        x = 0; y = 0
        w = turtle.Screen()
        w.setup(800, 700)
        w.title("Welcome to the turtle zoo!")
        w.clear()
        w.bgcolor("#ffffff")
        w.visible = True
        t = turtle.Turtle()
        circle(t,x,y)
        w.exitonclick()
    finally:
        turtle.Terminator()


def newWin1(): # new window definition
    newwin = Toplevel()
    display = Label(newwin, text="Window 1")
    display.pack()    
 
def newWin2(): # new window definition
    newwin = Toplevel()
    display = Label(newwin, text="Window 2")
    display.pack()    
 

def main():

    root = Tk()
    import sys
    print(sys.version)
    button1 =Button(root, text ="Window 1", command =newWin1) 
    button2 =Button(root, text ="Window 2", command =newWin2) 
    button3 =Button(root, text ="Turtle Window", command =turtle1) 
    button1.pack()
    button2.pack()
    button3.pack()

    root.mainloop()


if __name__ == '__main__':
    main()
windows 8.1 , python 3.7.4
Reply


Messages In This Thread
tkinter window and turtle window error - by 1885 - Nov-01-2019, 12:44 PM
RE: tkinter window and turtle window error - by balenaucigasa - Nov-01-2019, 10:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Interaction between Matplotlib window, Python prompt and TKinter window NorbertMoussy 3 588 Mar-17-2024, 09:37 AM
Last Post: deanhystad
  [Tkinter] CTkScrollableDropdown error: bad window path name ".!ctkscrollabledropdown" CopperGenie 1 448 Mar-03-2024, 04:32 AM
Last Post: deanhystad
  [Tkinter] (CLOSED) CTkScrollableDropdown error: bad window path name ".!ctkscrollabledropdown" CopperGenie 4 679 Mar-03-2024, 03:21 AM
Last Post: CopperGenie
  Transparent window background, but not text on it muzicman0 7 2,957 Feb-02-2024, 01:28 AM
Last Post: Joically
  Tkinter multiple windows in the same window tomro91 1 893 Oct-30-2023, 02:59 PM
Last Post: Larz60+
  [Tkinter] Modal window DPaul 14 2,738 Oct-18-2023, 06:11 AM
Last Post: DPaul
  [PyQt] PyQt5 window closing when trying to display a graph bianca 4 1,772 Aug-12-2023, 03:25 PM
Last Post: bianca
Exclamation [Tkinter] Error when closing the main window with destroy TomasSanchexx 1 816 Aug-06-2023, 01:54 AM
Last Post: deanhystad
  Place QT Window in the middle AlphaInc 10 2,341 Aug-03-2023, 05:40 PM
Last Post: Axel_Erfurt
  Centering and adding a push button to a grid window, TKinter Edward_ 15 5,016 May-25-2023, 07:37 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020