Sunday, November 25, 2018

Calculator (graphic user interface)

• PYTHON PROGRAMING LANGUAGE(GUI CALCULATOR WITH TKINTER)

Output:

from tkinter import *

def btnclick(number):
global operator
operator = operator + str(number)
text_input.set(operator)

def btnclear():
global operator
operator=""
text_input.set("")

def btnenter():
global operator
sumup = str(eval(operator))
text_input.set(sumup)
operator=""

def btnstart(number):
text_input.set(number)
print(number)

cal = Tk()
cal.title("Color full calculator with cleveraadi")
cal.geometry("340x490")
cal.minsize(340,490)
cal.maxsize(340,490)

operator= ""
text_input = StringVar()

#display for input.,
text_display= Entry(cal,textvariable=text_input,insertwidth=5,
font="comicsansms 20 bold",justify="right",bd=18,bg="blue")
text_display.grid(columnspan=4)

#buttons.

command=lambda: btnclick(7))
b7.grid(row=1,column=0)

command=lambda: btnclick(8))
b8.grid(row=1,column=1)

command=lambda: btnclick(9))
b9.grid(row=1,column=2)

command=lambda :btnstart(0))

start.grid(row=1,column=3)

#row=second now start........

command=lambda: btnclick(4))
b4.grid(row=2,column=0)

command=lambda: btnclick(5))
b5.grid(row=2,column=1)

command=lambda: btnclick(6))
b6.grid(row=2,column=2)

command=lambda :btnclick("+"))

# third rows.

command=lambda: btnclick(9))
b3.grid(row=3,column=0)

command=lambda: btnclick(2))
b2.grid(row=3,column=1)

command=lambda: btnclick(1))
b1.grid(row=3,column=2)

command=lambda :btnenter())
enter.grid(row=3,column=3)

#4th row's......

command=lambda:btnclick(0))
zero.grid(row=4,column=0)

command=lambda :btnclick('/'))
btndiv.grid(row=4,column=1)

command=lambda :btnclick('*'))
btnmul.grid(row=4,column=2)

command=lambda :btnclick('-'))
btnsub.grid(row=4,column=3)

#clear clear
clear=Button(cal,text="Clear && Double click Exit",padx=145,pady=8,bd=4,font="cominsansms 10 bold",fg="green",
command = lambda:btnclear())
clear.place(x=1,y=445)
clear.bind('<Double-1>',quit)

cal.mainloop()

Arrays in Solidity Programming Language.

Arrays Solidity supports both generic and byte arrays. It supports both fixed size and dynamic arrays. It also supports multidimensional ...