Answers for "python turtle pop up window"

2

make a pop up window in python

from tkinter import *

def alert_popup(title, message, path):
    """Generate a pop-up window for special messages."""
    root = Tk()
    root.title(title)
    w = 400     # popup window width
    h = 200     # popup window height
    sw = root.winfo_screenwidth()
    sh = root.winfo_screenheight()
    x = (sw - w)/2
    y = (sh - h)/2
    root.geometry('%dx%d+%d+%d' % (w, h, x, y))
    m = message
    m += 'n'
    m += path
    w = Label(root, text=m, width=120, height=10)
    w.pack()
    b = Button(root, text="OK", command=root.destroy, width=10)
    b.pack()
    mainloop()
Posted by: Guest on October-25-2020
4

turtle circle() python

import turtle
t = turtle.Turtle()
t.color(color) # choose a color
t.begin_fill() # if you want it to be filled with color later
t.circle(10) # the function "circle" and the radious.
t.end_fill() # completing the filling of the circle. 
# try to do it and see if it works. it worked for me.
Posted by: Guest on January-09-2021
3

Python turtle setup

import turtle
window_Name = turtle.Sreen()
turtle_Name = turtle.Turtle()
Posted by: Guest on August-17-2020

Python Answers by Framework

Browse Popular Code Answers by Language