Search
 
SCRIPT & CODE EXAMPLE
 

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()
Comment

PREVIOUS NEXT
Code Example
Python :: python pandas convert series to percent 
Python :: circular list python 
Python :: how to get confusion matrix in python 
Python :: if else one line python 
Python :: dataset for cancer analysis in python 
Python :: pythob password generator 
Python :: dataframe select data type 
Python :: make a gif with images python 
Python :: asymmetric encryption python 
Python :: how to get input with python 
Python :: yaxis on the right matplotlib 
Python :: python youtube download mp3 
Python :: python zip folder 
Python :: pytorch transpose 
Python :: find data in sheet pandas 
Python :: python print with 2 decimals 
Python :: how to print a column from csv file in python 
Python :: drop all unnamed columns pandas 
Python :: create or append dataframe to csv python 
Python :: matplotlib python background color 
Python :: python create path 
Python :: can is slice list with list of indices python 
Python :: dataframe in python 
Python :: how to remove none in python 
Python :: pyqt button clicked connect 
Python :: python array colon 
Python :: how to get local ip in python 
Python :: random python between 0 and 1 
Python :: pandas convert first row to header 
Python :: print in python without using print 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =