Answers for "how to draw a line in tkinter"

1

draw line tkinter

#Drawing basic line on the canvas  
from tkinter import *  
from tkinter import ttk  
app=Tk()  
#App Title  
app.title("Python GUI Application ")  
#Lable  
name=ttk.Label(app, text="Draw basic line")  
name.pack()  
#Canvas  
canvas=Canvas(app)  
canvas.pack()  
canvas.config(width=480,height=360)  
#Canvas values  
line=canvas.create_line(60,160,280,90,fill='blue',width=5)  
#Calling Main()  
app.mainloop()  
Posted by: Guest on May-06-2021
3

tkinter draw squaer

canvas.create_rectangle(30, 10, 120, 80,
    outline="#fb0", fill="#fb0")
Posted by: Guest on February-19-2020
0

tkinter create_line

canvas.create_line(15, 25, 200, 25)
Posted by: Guest on June-20-2020
1

how to draw polygon in tkinter

from tkinter import *

root = Tk()

c = Canvas(root)
c.pack()

points = [x1,y1, x2,y2, xn,yn]
c.create_polygon(points)

root.mainloop()
Posted by: Guest on July-01-2020

Code answers related to "how to draw a line in tkinter"

Python Answers by Framework

Browse Popular Code Answers by Language