Python Programlama Dilini Öğrenmek İsteyenler

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 28 Haz 2016 12:33:04
[linkler sadece üyelerimize görünmektedir.]
buradan bakıp yapmıştım:
[linkler sadece üyelerimize görünmektedir.]
Teşekkürler bilgi için. Örnekleriyle konu anlatımını bulamamıştım.

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 28 Haz 2016 17:47:48
Çalar saat ve müzik çalar programından alıntı yaparak müzik çalar programı oluşturdum.

---------------
import pygame
from tkinter import *
import tkinter.ttk as ttk
import glob
import os

pencere = Tk()
pencere.tk_setPalette("#D0A9F5")
pencere.geometry("800x150+250+120")

pygame.mixer.init()

liste= (glob.glob("*.mp3"))

if len(liste)<1:
    showinfo("UYARI !","Programın bulunduğu dizine birkaç şarkı ekleyin !")
    pencere.destroy()

label1 = Label(text="Müzik seç : ")
label1.place(x=10, y=20)

combo = ttk.Combobox()
combo["values"] = liste
combo.set(liste[0])
combo.place(x=80, y=20)

label2 = Label(text="Ses : ")
label2.place(x=250, y=20)

def çal1():
    pygame.mixer.music.stop()

def çal2():
     pygame.mixer.music.unpause()

def çal3():
     pygame.mixer.music.pause()

def çal15():
    pygame.mixer.music.rewind()

def çal5():
    pygame.mixer.music.load(combo.get())
    pygame.mixer.music.play()

frame1 = Frame(pencere)
frame1.pack(side = BOTTOM)

buton1=Button(frame1)
buton1.config(text="baştan çal",command=çal15)
buton1.pack(side=RIGHT)

buton2=Button(frame1)
buton2.config(text="duraklat",command=çal3)
buton2.pack(side=RIGHT)

buton3=Button(frame1)
buton3.config(text="devam",command=çal2)
buton3.pack(side=RIGHT)

buton4=Button(frame1)
buton4.config(text="dur",command=çal1)
buton4.pack(side=RIGHT)

buton5=Button(frame1)
buton5.config(text="çal",command=çal5)
buton5.pack(side=RIGHT)

def ça21():
    pygame.mixer.music.load("a.mp3")
    pygame.mixer.music.play()
   
def ça22():
    pygame.mixer.music.load("b.mp3")
    pygame.mixer.music.play()

def ça23():
    pygame.mixer.music.load("c.mp3")
    pygame.mixer.music.play()

def ça24():
    pygame.mixer.music.load("d.mp3")
    pygame.mixer.music.play()

def ça25():
    pygame.mixer.music.load("e.mp3")
    pygame.mixer.music.play()

def ses(_=None):
    pygame.mixer.music.set_volume(vol.get()/100)

vol = Scale(
    pencere,
    from_ = 0,
    to = 100,
    orient = HORIZONTAL ,
    resolution = 1,
    tickinterval=10,
    length=300,
    command=ses
    )
vol.set(100)
vol.pack()

mainloop()

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 28 Haz 2016 18:59:06
Çalar saat ve müzik çalar programından alıntı yaparak müzik çalar programını geliştirdim. İkonlar ektedir.
---
import pygame
from tkinter import *
import tkinter.ttk as ttk
import glob
import os
from PIL import ImageTk, Image

pencere = Tk()
pencere.tk_setPalette("light green")
pencere.geometry("800x300+250+120")

play = ImageTk.PhotoImage(file="play.png")
stop = ImageTk.PhotoImage(file="stop.png")
pause = ImageTk.PhotoImage(file="pause.png")
rewind = ImageTk.PhotoImage(file="rewind.png")
devam = ImageTk.PhotoImage(file="devam.png")

pygame.mixer.init()

liste= (glob.glob("*.mp3"))

if len(liste)<1:
    showinfo("UYARI !","Programın bulunduğu dizine birkaç şarkı ekleyin !")
    pencere.destroy()

label1 = Label(text="Müzik seç : ")
label1.place(x=10, y=20)

combo = ttk.Combobox()
combo["values"] = liste
combo.set(liste[0])
combo.place(x=80, y=20)

label2 = Label(text="Ses : ")
label2.place(x=250, y=20)

def çal1():
    pygame.mixer.music.stop()

def çal2():
     pygame.mixer.music.unpause()

def çal3():
     pygame.mixer.music.pause()

def çal15():
    pygame.mixer.music.rewind()

def çal5():
    pygame.mixer.music.load(combo.get())
    pygame.mixer.music.play()

frame1 = Frame(pencere)
frame1.pack(side = BOTTOM)

buton1=Button(frame1)
buton1.config(text="baştan çal",image=rewind,compound="top",command=çal15)
buton1.pack(side=RIGHT)

buton2=Button(frame1)
buton2.config(text="duraklat",image=pause,compound="top",command=çal3)
buton2.pack(side=RIGHT)

buton3=Button(frame1)
buton3.config(text="devam",image=devam,compound="top",command=çal2)
buton3.pack(side=RIGHT)

buton4=Button(frame1)
buton4.config(text="dur",image=stop,compound="top",command=çal1)
buton4.pack(side=RIGHT)

buton5=Button(frame1)
buton5.config(text="çal",image=play,compound="top",command=çal5)
buton5.pack(side=RIGHT)

def ça21():
    pygame.mixer.music.load("a.mp3")
    pygame.mixer.music.play()
   
def ça22():
    pygame.mixer.music.load("b.mp3")
    pygame.mixer.music.play()

def ça23():
    pygame.mixer.music.load("c.mp3")
    pygame.mixer.music.play()

def ça24():
    pygame.mixer.music.load("d.mp3")
    pygame.mixer.music.play()

def ça25():
    pygame.mixer.music.load("e.mp3")
    pygame.mixer.music.play()

def ses(_=None):
    pygame.mixer.music.set_volume(vol.get()/100)

vol = Scale(
    pencere,
    from_ = 0,
    to = 100,
    orient = HORIZONTAL ,
    resolution = 1,
    tickinterval=10,
    length=300,
    command=ses
    )
vol.set(100)
vol.pack()

mainloop()


------

Çevrimdışı smyi

  • Bilge Meclis Üyesi
  • *****
  • 4.274
  • 23.644
  • 4. Sınıf Öğretmeni
  • 4.274
  • 23.644
  • 4. Sınıf Öğretmeni
# 29 Haz 2016 10:14:00
bu programda da Listbox kullandım.
Listbox ile ilgili kaynak isterseniz tek bir kaynak söyleyemem çünkü oradan biraz şuradan biraz kod alarak yaptım.

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 30 Haz 2016 22:36:00
combobox ta müzik çalar programını biraz geliştirdim. Şarkı seçilince çalmaya başlıyor.
-----
import pygame
from tkinter import *
import tkinter.ttk as ttk
import glob
import os
from PIL import ImageTk, Image

pencere = Tk()
pencere.tk_setPalette("light green")
pencere.geometry("800x300+250+120")

play = ImageTk.PhotoImage(file="play.png")
stop = ImageTk.PhotoImage(file="stop.png")
pause = ImageTk.PhotoImage(file="pause.png")
rewind = ImageTk.PhotoImage(file="rewind.png")
devam = ImageTk.PhotoImage(file="devam.png")

pygame.mixer.init()

liste= (glob.glob("*.mp3"))

if len(liste)<1:
    showinfo("UYARI !","Programın bulunduğu dizine birkaç şarkı ekleyin !")
    pencere.destroy()

label1 = Label(text="Müzik seç : ")
label1.place(x=10, y=20)

combo = ttk.Combobox()
combo["values"] = liste
combo.set(liste[0])
combo.place(x=80, y=20)

label2 = Label(text="Ses : ")
label2.place(x=250, y=20)

def çal1():
    pygame.mixer.music.stop()

def çal2():
     pygame.mixer.music.unpause()

def çal3():
     pygame.mixer.music.pause()

def çal15():
    pygame.mixer.music.rewind()

def çal5(event=None):
    pygame.mixer.music.load(combo.get())
    pygame.mixer.music.play()
   
combo.bind('<<ComboboxSelected>>', çal5)

frame1 = Frame(pencere)
frame1.pack(side = BOTTOM)

buton1=Button(frame1)
buton1.config(text="baştan çal",image=rewind,compound="top",command=çal15)
buton1.pack(side=RIGHT)

buton2=Button(frame1)
buton2.config(text="duraklat",image=pause,compound="top",command=çal3)
buton2.pack(side=RIGHT)

buton3=Button(frame1)
buton3.config(text="devam",image=devam,compound="top",command=çal2)
buton3.pack(side=RIGHT)

buton4=Button(frame1)
buton4.config(text="dur",image=stop,compound="top",command=çal1)
buton4.pack(side=RIGHT)

buton5=Button(frame1)
buton5.config(text="çal",image=play,compound="top",command=çal5)
buton5.pack(side=RIGHT)

def ses(_=None):
    pygame.mixer.music.set_volume(vol.get()/100)

vol = Scale(
    pencere,
    from_ = 0,
    to = 100,
    orient = HORIZONTAL ,
    resolution = 1,
    tickinterval=10,
    length=300,
    command=ses
    )
vol.set(100)
vol.pack()

mainloop()

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 01 Tem 2016 08:05:36
şifre girme programı
--------------
from tkinter import *
import time


bilgiler=("a","1")
denemehakkı=3
zaman=0

def girişyap():
    global denemehakkı,zaman
   
    if denemehakkı <= 0:
        if time.time()-zaman >=5:
            denemehakkı=3
        else:
            sonuç.config(text="5 sn beklemeniz gerekli." )
            return False
   
    kadı=isim.get()
    parola=şifre.get()
    print (kadı , " - ",parola)
    print("Kotrol ediliyor")
    if kadı ==bilgiler[0] and parola ==bilgiler[1]:
        print("Bilgiler doğru!")
        sonuç.config(text="Başarıyla giriş yapıldı.")
        ekranıtemizle()
    else:
        print("Bilgiler yanlış")
        denemehakkı -=1
        if denemehakkı ==0:
            zaman=time.time()
        sonuç.config(text="Bilgiler yanlış! Kalan deneme: %d" %denemehakkı)
       

def ekranıtemizle():
    karşılama.config(text="Sisteme hoşgeldiniz.")
    isimsor.destroy()
    isim.destroy()
    şifresor.destroy()
    şifre.destroy()
    buton.destroy()
    pencere.destroy()
   

pencere=Tk()
pencere.overrideredirect(1)
pencere.title("Giriş Ekranı")
pencere.geometry("400x400+100+100")
karşılama=Label(pencere)
karşılama.config(text="Hoşgeldiniz, lütfen giriş yapınız.")
karşılama.pack()

isimsor=Label(pencere)
isimsor.config(text="Kullanıcı Adı:")
isimsor.pack()

isim=Entry(pencere)
isim.pack()

şifresor=Label(pencere)
şifresor.config(text="Şifre:")
şifresor.pack()

şifre=Entry(pencere)
şifre.pack()

buton=Button(pencere)
buton.config(text="Giriş Yap!",command=girişyap)
buton.pack()

sonuç=Label(pencere)
sonuç.config(text="Henüz giriş yapılmadı.")
sonuç.pack()

mainloop()

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 02 Tem 2016 12:58:15
Haydi hep birlikte Python Sqlite3 ile bir adres defteri programı yapalım. Katkılarınızı bekliyorum.

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 03 Tem 2016 07:57:05
[linkler sadece üyelerimize görünmektedir.]
Haydi hep birlikte Python Sqlite3 ile bir adres defteri programı yapalım. Katkılarınızı bekliyorum.
Yaptığım ilk Adres Defteri Programı linki ve ekran görüntüsü

[linkler sadece üyelerimize görünmektedir.]

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 03 Tem 2016 21:36:46
Yaptığım Adres Defteri Programının 2.sürümü ekran görüntüsü

Çevrimdışı php_korsan

  • Bilge Üye
  • *****
  • 13.107
  • 14.678
  • 13.107
  • 14.678
# 03 Tem 2016 22:39:18
bu ay başlıyorum hocam artık bilişim. yüksek lidsnstayim

Çevrimdışı php_korsan

  • Bilge Üye
  • *****
  • 13.107
  • 14.678
  • 13.107
  • 14.678
# 03 Tem 2016 22:40:00
bu ay başlıyorum hocam artık bilişim. yüksek lidsanstayim

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 03 Tem 2016 22:43:50
[linkler sadece üyelerimize görünmektedir.]
bu ay başlıyorum hocam artık bilişim. yüksek lidsanstayim
Hayırlı olsun.

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 03 Tem 2016 23:16:54
Yaptığım Adres Defteri Programında aşağıdaki modüller kullanılmıştır.

from tkinter import *
import sqlite3
import tkinter.ttk as ttk
import os

Sırası geldikçe parça parça yapılışını paylaşacağım. Çünkü program 370 satırdan oluşuyor.

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 04 Tem 2016 10:53:51
Adres Defteri Programında bugün Label ı paylaşacağım.
---------------------
ttk.Label(mainframe, text ='Sıra No').grid(column = 1, row = 0)
ttk.Label(mainframe, text ='Adı').grid(column = 1, row = 1)
ttk.Label(mainframe, text ='Soyadı').grid(column = 1, row=2)
ttk.Label(mainframe, text ='Cep Tel').grid(column = 1, row=3)
ttk.Label(mainframe, text ='Ev Tel').grid(column = 1, row=4)
ttk.Label(mainframe, text ='İş Tel').grid(column = 1, row=5)
ttk.Label(mainframe, text ='Faks No').grid(column = 1, row=6)
ttk.Label(mainframe, text ='Doğum Günü').grid(column = 1, row=7)
ttk.Label(mainframe, text ='E-posta').grid(column = 1, row=8)
ttk.Label(mainframe, text ='Web Sitesi').grid(column = 1, row=9)
ttk.Label(mainframe, text ='Ev Adresi').grid(column = 1, row=10)
ttk.Label(mainframe, text ='İş Adresi').grid(column = 1, row=11)
ttk.Label(mainframe, text ='Notlar').grid(column = 1, row=12)

-------------------------

Çevrimdışı gokselgursu

  • Bilge Meclis Üyesi
  • *****
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
  • 3.992
  • 13.311
  • 3. Sınıf Öğretmeni
# 05 Tem 2016 08:54:44
Yaptığım 2.sürüm Adres Defteri Programı linki ve ekran görüntüsü

[linkler sadece üyelerimize görünmektedir.]


 


Egitimhane.Com ©2006-2023 KVKK