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 Tkinter - Canvas Widget
- Python Tkinter | Moving objects using Canvas.move() method
- Python | Create a GUI Marksheet using Tkinter
- Create First GUI Application using Python-Tkinter
- Create a Yes/No Message Box in Python using tkinter
- Python | Create a digital clock using Tkinter
- Python Tkinter | Create LabelFrame and add widgets to it
- Create MySQL Database Login Page in Python using Tkinter
- matplotlib.lines.VertexSelector class in Python
- Create Air Canvas using Python-OpenCV
- Python - Convert simple lines to bulleted lines using the Pyperclip module
- How to create an empty class in Python?
- How to create a list of object in Python class
- Create Table Using Tkinter
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.