1#Drawing basic line on the canvas
2from tkinter import *
3from tkinter import ttk
4app=Tk()
5#App Title
6app.title("Python GUI Application ")
7#Lable
8name=ttk.Label(app, text="Draw basic line")
9name.pack()
10#Canvas
11canvas=Canvas(app)
12canvas.pack()
13canvas.config(width=480,height=360)
14#Canvas values
15line=canvas.create_line(60,160,280,90,fill='blue',width=5)
16#Calling Main()
17app.mainloop()
1from Tkinter import *
2master = Tk()
3
4w = Canvas(master, width=250, height=200)
5w.create_rectangle(0, 0, 100, 100, fill="blue", outline = 'blue')
6w.create_rectangle(50, 50, 100, 100, fill="red", outline = 'blue')
7w.pack()
8master.mainloop()