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 | Moving objects using Canvas.move() method
- Python | Create a GUI Marksheet using Tkinter
- Python | Create a digital clock using Tkinter
- Python Tkinter | Create LabelFrame and add widgets to it
- How to create an empty class in Python?
- How to create a list of object in Python class
- Python GUI - tkinter
- RadioButton in Tkinter | Python
- Python: Age Calculator using Tkinter
- Different messages in Tkinter | Python
- Python | after method in Tkinter
- Python | place() method in Tkinter
- Python | Creating a button in tkinter
- Python | Loan calculator 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 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.