![]() |
VOOZH | about |
Tkinter is a GUI toolkit used in python to make user-friendly GUIs.Tkinter is the most commonly used and the most basic GUI framework available in python. Tkinter uses an object-oriented approach to make GUIs.
Note: For more information, refer to Python GUI – tkinter
The Canvas widget lets us display various graphics on the application. It can be used to draw simple shapes to complicated graphs. We can also display various kinds of custom widgets according to our needs.
Syntax:
C = Canvas(root, height, width, bd, bg, ..)
Optional parameters:
oval = C.create_oval(x0, y0, x1, y1, options)
arc = C.create_arc(20, 50, 190, 240, start=0, extent=110, fill="red")
line = C.create_line(x0, y0, x1, y1, ..., xn, yn, options)
oval = C.create_polygon(x0, y0, x1, y1, ...xn, yn, options)
Example 1: Simple Shapes Drawing
Output:
Example 2: Simple Paint App