wWw.dObRidOlli-FoRuM.Tk & ShQiPeT4EveR FoRuM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

wWw.dObRidOlli-FoRuM.Tk & ShQiPeT4EveR FoRuM

wWw.dObRidOlli-FoRuM.Tk & ShQiPeT4EveR FoRuM
 
ForumGalleryKërkoLatest imagesRegjistrohuidentifikimi
identifikimi
Identifikimi:
Fjalëkalimi:
Më Identifiko Automatikisht: 
:: Harrova fjalkalimin
Navigacion
 Portali
 Indeksi
 Lista e Anëtarëve
 Profili
 Pytësori
 Kërko
Tema Fundit
» Te gjejme origjinen tone
Kalkulator i thjeshte - Python SRC Icon_minitimeMon Jan 30, 2012 4:55 pm nga mikele

» Gazeta Express
Kalkulator i thjeshte - Python SRC Icon_minitimeWed Dec 08, 2010 10:38 pm nga otr

» Horoskopi
Kalkulator i thjeshte - Python SRC Icon_minitimeWed Dec 08, 2010 10:37 pm nga otr

» BotaSot - E përditshme Informative Kosovare.
Kalkulator i thjeshte - Python SRC Icon_minitimeWed Dec 08, 2010 10:37 pm nga otr

» Kosova Sot
Kalkulator i thjeshte - Python SRC Icon_minitimeWed Dec 08, 2010 10:36 pm nga otr

» Top Channel TV
Kalkulator i thjeshte - Python SRC Icon_minitimeWed Dec 08, 2010 10:36 pm nga otr

» LESNA
Kalkulator i thjeshte - Python SRC Icon_minitimeWed Dec 08, 2010 10:35 pm nga otr

» Horoskopi Ditor
Kalkulator i thjeshte - Python SRC Icon_minitimeWed Dec 08, 2010 10:34 pm nga otr

» InfoPress
Kalkulator i thjeshte - Python SRC Icon_minitimeWed Dec 08, 2010 10:33 pm nga otr

Kërko
 
 

Display results as :
 
Rechercher Advanced Search
NjE iNfO tE shKuRt ! ! !
мιя ѕє νιηι ηє ωωω.∂σвяι∂σℓℓι-ƒσяυм.тк & ѕнqιρєтЧєνєя ƒσяυм / ∂ιcкα qє ѕмυη∂єηι тα кυρтσηι мυη∂єт тє кσηтαктσηι ρєямєѕ є-мαιℓ: ∂σвяι∂σℓℓι@нσтмαιℓ.cσм & вσѕѕι_ף2@нσтмαιℓ.cσм ∂нє ѕαℓι@∂ємιяι.cσм / ѕтαƒι ι ƒσяυмιт נυ υяση кαℓιм ѕα мë тë мιя . . . ! ! ! :∂ . . .
May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendarCalendar
Statistikat
Forumi ka 103 anëtarë të regjistruar
Anëtari më i ri xhezmi_hysenaj@yahoo.com

Anëtarët e këtij forumi kanë postuar 449 artikuj v 404 temat
Kush është në linjë
5 përdorues në linjë: 0 anëtarë 0 të fshehur 5 vizitorë

Asnjë

Rekord i përdoruesve në linjë ishte 33 më Tue Dec 26, 2023 8:05 pm

 

 Kalkulator i thjeshte - Python SRC

Shko poshtë 
AutoriMesazh
KinG.M.H.S.

KinG.M.H.S.


Numri i postimeve : 59
Join date : 21/09/2010

Kalkulator i thjeshte - Python SRC Empty
MesazhTitulli: Kalkulator i thjeshte - Python SRC   Kalkulator i thjeshte - Python SRC Icon_minitimeTue Sep 21, 2010 8:32 pm

Kalkulator i thjeshte - Python SRC Asimplecalculator
Kodi:
from Tkinter import *

def frame(root, side):
    w = Frame(root)
    w.pack(side=side, expand=YES, fill=BOTH)
    return w

def button(root, side, text, command=None):
    w = Button(root, text=text, command=command)
    w.pack(side=side, expand=YES, fill=BOTH)
    return w

class Calculator(Frame):
    def __init__(self):
        Frame.__init__(self)
        self.option_add('*Font', 'Verdana 12 bold')
        self.pack(expand=YES, fill=BOTH)
        self.master.title('Simple Calculator')
        self.master.iconname("calc1")

        display = StringVar()
      Entry(self, relief=SUNKEN,
    textvariable=display).pack(side=TOP, expand=YES,
      fill=BOTH)

        for key in ("123", "456", "789", "-0."):
            keyF = frame(self, TOP)
            for char in key:
                button(keyF, LEFT, char,
                      lambda w=display, c=char: w.set(w.get() + c))

        opsF = frame(self, TOP)
        for char in "+-*/=":
            if char == '=':
                btn = button(opsF, LEFT, char)
                btn.bind('<ButtonRelease-1>',
                        lambda e, s=self, w=display: s.calc(w), '+')
            else:
                btn = button(opsF, LEFT, char,
                  lambda w=display, s=' %s '%char: w.set(w.get()+s))

        clearF = frame(self, BOTTOM)
        button(clearF, LEFT, 'Clr', lambda w=display: w.set(''))

    def calc(self, display):
        try:
            display.set('eval(display.get())')
        except:
            display.set("ERROR")

if __name__ == '__main__':
    Calculator().mainloop()
Mbrapsht në krye Shko poshtë
 
Kalkulator i thjeshte - Python SRC
Mbrapsht në krye 
Faqja 1 e 1

Drejtat e ktij Forumit:Ju nuk mund ti përgjigjeni temave të këtij forumi
wWw.dObRidOlli-FoRuM.Tk & ShQiPeT4EveR FoRuM :: Programim :: Asnjë postim i ri Perl // Ruby // Python-
Kërce tek: