About 141 results
Open links in new tab
  1. python - How to draw a right angle triangle using tkinter

    Oct 5, 2020 · You can use polygon-function to draw a triangle. Just specify a list of corner-points of your triangle as argument. points = [x1,y1, x2,y2, x3,y3] can.create_polygon(points, fill='white') Check out the tkinter-documentation for more info.

  2. How to Draw Different Shapes Using Tkinter - AskPython

    Jan 29, 2022 · In this tutorial, we’ll learn how to draw different shapes in Tkinter such as square, circle, rectangle, oval, arc, etc. In Tkinter, the canvas class is used to draw different shapes in our application window. Functions to draw shapes are defined in canvas class so we need to define the canvas class first.

  3. python - how do I make a triangle with a provided x and y …

    Jul 10, 2022 · I have a some code to create a triangle from tkinter import * tk = Tk () tk.geometry ("600x600") canvas = Canvas (tk) def triangle (x, y, w, h): points = [x, y, (x+h)- (w/2), (x+h)+ (w/2...

  4. Create different shapes using Canvas class in TkinterPython

    Apr 12, 2025 · Here are some essential methods provided by the Canvas class to create various shapes: Canvas.create_oval (x1, y1, x2, y2, options = …): Used to create ovals, pie slices, and chords. The parameters (x1, y1) and (x2, y2) define the bounding box of the oval. Canvas.create_rectangle (x1, y1, x2, y2, options = …): Used to create rectangles and squares.

  5. Draw, Resize and Move a triangle on Canvas with Tkinter (Python)

    Aug 23, 2021 · Do you want to produce regular polygons or free-hand (irregular) polygons? @Derek by that command create_polygon is the only way u can create a triangle in tkinter. As a result, I would like to produce regular polygons.

  6. Tkinter Triangle Art (Python) | DaniWeb - DaniWeb Community

    Jun 27, 2006 · This time we use the Tkinter GUI canvas and its create_line() function to draw a triangle, or a series of connected triangles to create something that looks like fancy art work. You might be able to impress grandmama with that one!

  7. Tkinter Triangle-Area GUI

    In this assignment you will construct a simple Tkinter program that displays the area of a triangle selected by the user. The user interface will look something like this: Complete your work for this assignment in the file heron.py, and submit this file via csman when you are finished.

  8. GUI with autogenerated triangles - Pythoneo

    Dec 17, 2020 · Upon execution, it programmatically draws a specified number of triangles with random positions and colors onto this canvas. This example serves as a basic introduction to graphical programming with Tkinter and demonstrates fundamental concepts like canvas drawing and random number generation.

  9. Tkinter - The Reuleaux Triangle - Python Forum

    Oct 6, 2020 · Hello everyone, I need help drawing a Reuleaux Triangle using 3 create_arc method. Unfortunately, it is not a perfect circle, meaning the midpoint will be longer than a regular radius on a circle. The.

  10. Tkinter Canvas - Python Tutorial

    To draw a rectangle, you use the create_rectangle() method. For example: Output: To draw an oval, you use the create_oval() method. For example: (50, 150), (200, 350), Output: Like a rectangle, an oval takes the coordinate of the upper-left and lower-right corners of …

    Missing:

    • Triangle

    Must include:

Refresh