diff --git a/Calculator.mp4 b/Calculator.mp4 new file mode 100644 index 0000000..633fe27 Binary files /dev/null and b/Calculator.mp4 differ diff --git a/Problem Statement 1/README.md b/Problem Statement 1/README.md deleted file mode 100644 index 6aaeab6..0000000 --- a/Problem Statement 1/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Problem Statement-1. - - -*** -### Make a desktop assistant using Python as its backend - - - -*** - diff --git a/Problem Statement 2/README.md b/Problem Statement 2/README.md deleted file mode 100644 index baf2489..0000000 --- a/Problem Statement 2/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Problem Statement-2. - - -*** -### Make a Simple Image Editing app - - - -*** - diff --git a/Problem Statement 3/calculator.py b/Problem Statement 3/calculator.py new file mode 100644 index 0000000..5ab572c --- /dev/null +++ b/Problem Statement 3/calculator.py @@ -0,0 +1,23 @@ +from tkinter import * + +def btnClick(number): + global operator + operator=operator+str(number) + strrvar.set(operator) + +def btnClear(): + global operator + operator='' + strvar.set(operator) + +def result(): + global opearator + res=str(eval(operator)) + strvar.set(res) + +root=Tk() +root.title("Calculator") +operator='' +strvar=StringVar() + +ent=Entry(root,width=50, bd=5, font= diff --git a/Problem Statement 3/p1.py b/Problem Statement 3/p1.py new file mode 100644 index 0000000..dfbea32 --- /dev/null +++ b/Problem Statement 3/p1.py @@ -0,0 +1,3 @@ +import tkinter +wind1=tkinter.Tk() +wind1.title("New title of window") diff --git a/Problem Statement 3/p2.py b/Problem Statement 3/p2.py new file mode 100644 index 0000000..7f627ba --- /dev/null +++ b/Problem Statement 3/p2.py @@ -0,0 +1,4 @@ +import tkinter +root=tkinter.Tk() +tkinter.Button(root, text='Press Me', command=root.quit).pack() +root.mainloop() diff --git a/Problem Statement 3/p3.py b/Problem Statement 3/p3.py new file mode 100644 index 0000000..fb6a47e --- /dev/null +++ b/Problem Statement 3/p3.py @@ -0,0 +1,12 @@ +import tkinter + +def wquit(): + print('Hello, getting out of here') + +root=tkinter.Tk() +widget1=tkinter.Label(root, text='Hello there') +widget1.pack() +widget2=tkinter.Button(root, text='Click to quit', command=wquit) +widget2.pack() + +root.mainloop() diff --git a/Problem Statement 3/run.py b/Problem Statement 3/run.py new file mode 100644 index 0000000..cf46aae --- /dev/null +++ b/Problem Statement 3/run.py @@ -0,0 +1,81 @@ +from tkinter import * + +def btnClick(numbers): + global operator + operator= operator + str(numbers) + text_Input.set(operator) + +def btnClear(): + global operator + operator="" + text_Input.set("") + +def btnEquals(): + global operator + sumup= str(eval(operator)) + text_Input.set(sumup) + operator="" + +cal=Tk() +cal.title("Calculator") +operator="" +text_Input=StringVar() +txtDisplay= Entry(cal, font=('arial', 20, 'bold'), textvariable= text_Input, bd=30, insertwidth= 3, bg= "#FFFFFF", justify="right").grid(columnspan=4) + +################################################################################################################################################## +button7= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='7', command= lambda:btnClick(7)) +button7.grid(row=1, column=0) + +button8= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='8', command= lambda:btnClick(8)) +button8.grid(row=1, column=1) + +button9= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='9', command= lambda:btnClick(9)) +button9.grid(row=1, column=2) + +buttonAdd= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20 , 'bold'), text='+', command= lambda:btnClick("+")) +buttonAdd.grid(row=1, column=3) + +################################################################################################################################################## +button4= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='4', command= lambda:btnClick(4)) +button4.grid(row=2, column=0) + +button5= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='5', command= lambda:btnClick(5)) +button5.grid(row=2, column=1) + +button6= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20 , 'bold'), text='6 ', command= lambda:btnClick(6)) +button6.grid(row=2, column=2) + +buttonSub= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='-', command= lambda:btnClick("-")) +buttonSub.grid(row=2, column=3) + +################################################################################################################################################## +button1= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='1', command= lambda:btnClick(1)) +button1.grid(row=3, column=0) + +button2= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='2', command= lambda:btnClick(2)) +button2.grid(row=3, column=1) + +button3= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='3', command= lambda:btnClick(3)) +button3.grid(row=3, column=2) + +buttonMul= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20 , 'bold'), text='X', command= lambda:btnClick("*")) +buttonMul.grid(row=3, column=3) + +################################################################################################################################################## +button0= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='0', command= lambda:btnClick(0)) +button0.grid(row=4, column=0) + +buttonClr= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20 , 'bold'), text='C', command= lambda:btnClear()) +buttonClr.grid(row=4, column=1) + +buttonequal= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='=', command= lambda:btnEquals()) +buttonequal.grid(row=4, column=2) + +buttonDiv= Button(cal, padx=16, pady=16, bd=8, fg="black", font=('arial', 20, 'bold'), text='/', command= lambda:btnClick("/")) +buttonDiv.grid(row=4, column=3) + + + + + +cal.mainloop()