1 / 20

Graphical User Interface (GUI) Grafik Arayüzü

Graphical User Interface (GUI) Grafik Arayüzü. En çok bilinen GUI kütüphaneleri. Tkinter wxPython PyQt Pygame PyGTK. Tkinter ile wxPython. Sabittir, python kurulumu ile birlikte gelir. Öğrenmesi kolay Kötü görünüm

lisle
Download Presentation

Graphical User Interface (GUI) Grafik Arayüzü

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Graphical User Interface (GUI)Grafik Arayüzü

  2. En çok bilinen GUI kütüphaneleri • Tkinter • wxPython • PyQt • Pygame • PyGTK

  3. Tkinter ile wxPython • Sabittir, python kurulumu ile birlikte gelir. • Öğrenmesi kolay • Kötü görünüm • Bazı durularda ekstra kütüphane indirmek gerekebilir. (PMW gibi) • Çok karmaşık işler için uygun değildir. • Araçları(Widget) çok olan büyük • bir kütüphanedir. • Güzel bir görünüme sahiptir. • Esnek bir yapıya sahiptir. • Arada buglar yaratabilir. • İndirilip kurulması gereklidir. • Python 2.7 nin üzerini • desteklememektedir.

  4. Tkinter fromTkinterimport * root = Tk() #Program bu kısma yazılır root.mainloop()

  5. Tkinter fromTkinterimport * root = Tk() myContainer1 = Frame(root) myContainer1.pack() button1 = Button(myContainer1) button1["text"]= "Hello, World!" button1["background"] = "green" button1.pack() root.mainloop()

  6. Tkinter fromTkinterimport * classMyApp: def __init__(self, myParent): self.myContainer1 = Frame(myParent) self.myContainer1.pack() self.button1 = Button(self.myContainer1) self.button1["text"]= "Bir" self.button1.pack(side=LEFT) self.button2 = Button(self.myContainer1) self.button2.configure(text="Iki") self.button2.pack(side=LEFT)

  7. Tkinter self.button3 = Button(self.myContainer1) self.button3.configure(text="Uc", background = "blue") self.button3.pack(side=LEFT) self.label1 = Label(self.myContainer1,text = "Bes") self.label1.pack(side=RIGHT) self.button4 = Button(self.myContainer1) self.button4.configure(text="Dort", background = "green", command=self.Neriman) self.button4.pack()

  8. Tkinter def Neriman(self): print "Neriman" root = Tk() myapp = MyApp(root) root.mainloop()

  9. Tkinter fromTkinterimport * classMyApp: def __init__(self, myParent): self.myContainer1 = Frame(myParent) self.myContainer1.pack() self.labelSayi1 = Label(self.myContainer1, height=5) self.labelSayi1.configure(text="Sayi 1:") self.labelSayi1.pack(side = LEFT) self.entrySayi1 = Entry(self.myContainer1) self.entrySayi1.pack(side = LEFT) self.entrySayi2 = Entry(self.myContainer1) self.entrySayi2.pack(side = RIGHT) self.labelSayi2 = Label(self.myContainer1) self.labelSayi2.configure(text="Sayi 2:") self.labelSayi2.pack(side = RIGHT)

  10. Tkinter self.buttonsum = Button(self.myContainer1) self.buttonsum.configure(text="OBEB Hesapla", background = "green", command=self.OBEB_Hesapla) self.buttonsum.pack(side = BOTTOM, fill=X) def OBEB_Hesapla(self): #Entry den gelen degerler otomatik stringolduguicinint e ceviririz sayi1 = int(self.entrySayi1.get()) sayi2 = int(self.entrySayi2.get()) while sayi1: sayi1,sayi2 = (sayi2%sayi1),sayi1 sonuc = sayi2 printsonuc root = Tk() myapp = MyApp(root) root.mainloop()

  11. Soru • Tkinter kullanarak iki sayının aritmetik ortalamasını hesaplayan uygulamayı yazınız. • Programda bulunması gereken elemanlar, bir Frame, iki Entry, iki Label ve bir Button.

  12. Kod:

  13. Kod:

  14. Referanslar • https://wiki.python.org/moin/TkInter • http://thinkingtkinter.sourceforge.net/ • http://wiki.wxpython.org/Choosing%20wxPython%20over%20Tkinter

  15. Soru – Sezar Şifreleme (CeaserCipher) CeaserCipher bilinen en ilkel şifreleme metodudur. Verilen şifrelenecek yazının (plaintextin) her harfini verilen değer kadar kaydırıyoruz. (shift) Bu sayının 255i geçtikten sonra başa dönmesini sağlamak için mod(256) sını alıyoruz ve şifrelenmiş yazıyı elde ediyoruz.(ciphertext)

  16. Örnek • Plaintext: neriman kaydırma sayısı = 2 • Ciphertext: pgtkocp

  17. Kod:

  18. Kod:

  19. Kod: Sonuc:

  20. Referanslar • http://www.cihanyakar.com/index.php/sezar-sifreleme-caesar-cipher/ • http://www.stealthcopter.com/blog/2009/12/python-cryptography-caesar-shift-encryption-shift-cipher/ • http://stackoverflow.com/questions/8886947/caesar-cipher-function-in-python

More Related