Tags » Tkinter

Tk Functools callback loop

Improving My Python Tkinter Code

sub-titled: “Well, that shouldn’t be too difficult!”

I  fully admit that my coding overall, and especially my Tkinter code, should be a lot better after 9 months of self-learning. 1,221 more words

Tutorial

Python Code Snippets 21

Python Code Snippets #21

Hi code snippet fans. Well, here we go again. This is the start of the second batch of 100 code snippets. 1,776 more words

Newb Snippets Collection

TIM-Another Update-V1.70

TIM-The Insult Machine. Update V1.70

Download Tim v1.73 Freeware. Source and .exe (Please see end of post, as TIM now updated to 1.73 already)

I just couldn’t let it lie… 1,707 more words

Comment

Simple Python calculator using Tkinter

This is a code for simple python calculator written by me

#learnpythoncoding

from tkinter import*
root=Tk()
root.geometry("250x150")
root.title("CALCULATOR")

no1 = IntVar()
no2 = IntVar()

label1=Label(text="Enter 1st No.")
label1.grid(row=1)
label2=Label(text="Enter 2nd No.")
label2.grid(row=2)

entry1=Entry(root, textvariable=no1)
entry1.grid(row=1,column=1)
entry2=Entry(root, textvariable=no2)
entry2.grid(row=2,column=1)
txt =Text(root,width=25,height=2, wrap=WORD)
txt.grid(row=0,column=1)

def add():
    add = (no1.get() + no2.get())
    txt.insert(0.0,add)
def sub():
    sub = (no1.get() - no2.get())
    txt.insert(0.0,sub)
def mul():
    mul = (no1.get() * no2.get())
    txt.insert(0.0,mul)
def div():
    div = (no1.get() / no2.get())
    txt.insert(0.0,div)

b1=Button(root,text="add",command=add)
b1.grid(row=5,column=0)
b2=Button(root,text="sub",command=sub)
b2.grid(row=5,column=1)
b3=Button(root,text="mul",command=mul)
b3.grid(row=6,column=0)
b4=Button(root,text="div",command=div)
b4.grid(row=6,column=1)
root.mainloop()
                      
#blog

Pi with Neopixels/Simulated Neopixels

Neopixels are addressable full-colour RGB LEDs that come in a variety of different arrangements. Ranging from single LEDs, to matrix arrays and a variety of sewable components that can be used on wearable products. 827 more words

Python Code Snippets #20

Python Newb Code Snippets #20

96-Body Mass Index Calculator

BMI (Body Mass Index) is a rating calculated from the weight and height of a person to get a rough idea whether said human is under-weight, ‘normal’ or a tub of lard. 970 more words

Newb Snippets Collection