Canvas.create_line() method is used to create lines in any canvas. These lines can only be seen on canvas so first you need to create a Canvas object and later pack it to the main window.
Canvas.create_line(x1, y1, x2, y2, ...., options = ...)
Note: Minimum 4 points are required to create a line, but you can also add multiple points to create different drawings.
Class paramaters –
Data members used:
Member functions used for the given class: create() method
Widgets used: Canvas
Tkinter method used:
Below is the Python code –
- Python Tkinter | Create different shapes using Canvas class
- Python - Convert simple lines to bulleted lines using the Pyperclip module
- Python Tkinter | Moving objects using Canvas.move() method
- Python Tkinter - Canvas Widget
- Python | Create a digital clock using Tkinter
- Python | Create a GUI Marksheet using Tkinter
- Create a Yes/No Message Box in Python using tkinter
- Create MySQL Database Login Page in Python using Tkinter
- Create First GUI Application using Python-Tkinter
- Create Copy-Move GUI using Tkinter in Python
- Create Countdown Timer using Python-Tkinter
- Different messages in Tkinter | Python
- Create Air Canvas using Python-OpenCV
- Create Table Using Tkinter
- Python Tkinter | Create LabelFrame and add widgets to it
- matplotlib.lines.VertexSelector class in Python
- Tkinter Application to Switch Between Different Page Frames
- Create Find and Replace features in Tkinter Text Widget
- Draw a unstructured triangular grid as lines or markers in Python using Matplotlib
- Eliminating repeated lines from a file using Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.