from tkinter import *
window = Tk()
window.title("It's me Rakshit")
canvas_polygon = Canvas(width=800, height=620) #bg="yellow"
canvas_polygon.pack()
points=[225,110,480,200,280,280,250,110]
canvas_polygon.create_polygon(points,fill="yellow",outline="red")
# Create a Rectangle
# points_of_rectangle=[3,5,700,300]
# canvas_polygon.create_rectangle(points_of_rectangle,fill="grey")
#Text Alignment
coordinates=[700,590]
coordinates1=[700,610]
canvas_polygon.create_text(coordinates,text="It's an Example")
canvas_polygon.create_text(coordinates1,text="~Code by Rakshit")
window.mainloop()
#------------------------Create Line--------------------------
from tkinter import *
window = Tk()
window.title("It's me Rakshit")
canvas = Canvas(width=800, height=620) #bg="yellow"
canvas.pack(fill=BOTH,)
# This creates a line of length 520 (horizontal line)
canvas.create_line(15, 25, 520, 25)
window.mainloop()
Comments
Post a Comment
If you've any doubts, please let me text