Professional Documents
Culture Documents
Aipython Warmup Session 3
Aipython Warmup Session 3
AI/PYTHON_WARMUP_SESSION_3
HOME ASSIGNMENT 1
Source code:
IMPORT TKINTER AS TK
ROOT = TK.TK()
CANVAS1 = TK.CANVAS(ROOT, WIDTH=700, HEIGHT=500)
CANVAS1.PACK()
ENTRY1 = TK.ENTRY(ROOT)
CANVAS1.CREATE_WINDOW(270, 100, WINDOW=ENTRY1)
ENTRY2 = TK.ENTRY(ROOT)
CANVAS1.CREATE_WINDOW(270, 120, WINDOW=ENTRY2)
ENTRY3 = TK.ENTRY(ROOT)
CANVAS1.CREATE_WINDOW(270, 140, WINDOW=ENTRY3)
ENTRY4 = TK.ENTRY(ROOT)
CANVAS1.CREATE_WINDOW(270, 160, WINDOW=ENTRY4)
DEF VALUES():
OUTLOOK = FLOAT(ENTRY1.GET())
TEMP = FLOAT(ENTRY2.GET())
HUMIDITY = FLOAT(ENTRY3.GET())
WINDY = FLOAT(ENTRY4.GET())
ROOT.MAINLOOP()
Output
HOME ASSIGNMENT 2
Q1 What is the purpose of using tkinter library ?
It is used by the coders to add GUI widgets to the front end of the application