Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to make software in python

from Tkinter import *
import Tkinter
import tkMessageBox
def proces():
    number1=Entry.get(E1)
    number2=Entry.get(E2)
    operator=Entry.get(E3)
    number1=int(number1)
    number2=int(number2)
    if operator =="+":
        answer=number1+number2
    if operator =="-":
        answer=number1-number2
    if operator=="*":
        answer=number1*number2
    if operator=="/":
        answer=number1/number2
    Entry.insert(E4,0,answer)
    print(answer)

top = Tkinter.Tk()
L1 = Label(top, text="My calculator",).grid(row=0,column=1)
L2 = Label(top, text="Number 1",).grid(row=1,column=0)
L3 = Label(top, text="Number 2",).grid(row=2,column=0)
L4 = Label(top, text="Operator",).grid(row=3,column=0)
L4 = Label(top, text="Answer",).grid(row=4,column=0)
E1 = Entry(top, bd =5)
E1.grid(row=1,column=1)
E2 = Entry(top, bd =5)
E2.grid(row=2,column=1)
E3 = Entry(top, bd =5)
E3.grid(row=3,column=1)
E4 = Entry(top, bd =5)
E4.grid(row=4,column=1)
B=Button(top, text ="Submit",command = proces).grid(row=5,column=1,)

top.mainloop()
Comment

PREVIOUS NEXT
Code Example
Python :: how to delete item from list python 
Python :: list_display django foreign key 
Python :: pygame surface 
Python :: batch gradient descent 
Python :: max deviation in pandas 
Python :: pandas write image to excel 
Python :: Jinja for items in list 
Python :: create new column with mask pandas 
Python :: Yahoo! Finance pyhton 
Python :: python sort algorithm 
Python :: pandas rolling mean 
Python :: comment lister les fichiers un dossier avec python 
Python :: pandas count number of repetitions of each diferent value 
Python :: how to loop through pages of pdf using python 
Python :: python random number generator no duplicates 
Python :: cmd to get ip address python 
Python :: pandas change column type 
Python :: array concatenation in python 
Python :: date time shit pandas 
Python :: how to append in dictionary in python 
Python :: word2vec 
Python :: python datetime floor to hour 
Python :: how to set pandas dataframe as global 
Python :: python anytree 
Python :: turtle graphics documentation 
Python :: request download file 
Python :: to_frame python 
Python :: anagrams string python 
Python :: boto3.client python 
Python :: free download django app for windows 10 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =