Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

tkinter draw circle

from tkinter import *
root = Tk()
myCanvas = Canvas(root)
myCanvas.pack()

def create_circle(x, y, r, canvasName): #center coordinates, radius
    x0 = x - r
    y0 = y - r
    x1 = x + r
    y1 = y + r
    return canvasName.create_oval(x0, y0, x1, y1)

create_circle(100, 100, 20, myCanvas)
create_circle(50, 25, 10, myCanvas)
root.mainloop()
Comment

PREVIOUS NEXT
Code Example
Python :: mean deviation python 
Python :: load saved model pyspark 
Python :: Traceback (most recent call last): File "/usr/bin/pip", line 9, in <module from pip import main 
Python :: use beautifulsoup 
Python :: matplotlib x axis at the top 
Python :: custom 404 page flask 
Python :: how to delete print statement from console pythonn 
Python :: reduced fraction python 
Python :: python how to unnest a nested list 
Python :: PySpark get columns with missing values 
Python :: pandas not is na 
Python :: change the default python version mac 
Python :: python os output to variable 
Python :: Function to a button in tkinter 
Python :: how to add input box in tkinter 
Python :: check if any values overlap in numpy array 
Python :: csv from string python 
Python :: display text in pygame 
Python :: how to find the neighbors of an element in matrix python 
Python :: python xor two bytes 
Python :: random numbers in python 
Python :: how to check sklearn version 
Python :: how to read zip csv file in python 
Python :: Solving environment: failed with initial frozen solve. retrying with flexible solve 
Python :: background image in python 
Python :: python has duplicates 
Python :: import settings 
Python :: pandas resample backfill 
Python :: django check if url safe 
Python :: python youtube video downloader 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =