Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to make a button in python turtle

from turtle import Screen
from tkinter import *

screen = Screen()
screen.setup(width=600, height=400)


def do_something():
    print("Good bye")


canvas = screen.getcanvas()
button = Button(canvas.master, text="Exit", command=do_something)

button.pack()
button.place(x=300, y=100)  # place the button anywhere on the screen

screen.exitonclick()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #button #python #turtle
ADD COMMENT
Topic
Name
5+5 =