Computer >> Computer tutorials >  >> Programming >> Python

How to remove the outline of an oval in Tkinter?


With Tkinter canvas, we can draw shapes for 2D or 3D applications, we can create images, draw animation, and many more things. Let us suppose that we have to create an oval that should be drawn aesthetically on the canvas. There can be other features that can be present to give the oval and other shapes an aesthetic look. To remove the outlining from the shapes in the canvas, we can provide an empty value to the outline property in the method.

Example

#Import tkinter library
from tkinter import *
#Create an instance of tkinter frame or window
win= Tk()
#Set the geometry of tkinter frame
win.geometry("750x350")
#Create a canvas and an oval
canvas= Canvas(win, width=400, height=350,bg= "#458a4a")
canvas.create_oval(50,50,250,250, fill="white", outline="")
canvas.pack()
win.mainloop()

Output

Now, execute the code to display the output that contains an oval inside the canvas.

How to remove the outline of an oval in Tkinter?