furkaniko
Hectopat
- Katılım
- 17 Mart 2021
- Mesajlar
- 249
- Çözümler
- 1
Daha fazla
- Cinsiyet
- Erkek
- Meslek
- Siber Güvenlik Uzmanı
Arkadaşlar merhaba isim, soyisim telefon numarası gibi 12 sütundan oluşan bir sqlite veritabanım var ve entrye girdiğim isme göre ekrana sonuç getirilmesini istiyorum örneğin Furkan Yorulmaz'a dair telefon, memleket vs. gibi bilgiler.
Sorgulama olayını çözdüm isim yazdığımda veriyi çekebiliyorum ama pycharm ın shell ekranında gözüküyor veriler. Ben bu verileri her biri ayrı bir listbox (ya da entry veya textbox hangisine olursa) yazdırmak istiyorum bir türlü beceremedim. Yardımcı olur musunuz?
[CODE title="Kodlarım"]# Import module
import tkinter
from tkinter import *
from tkinter.ttk import *
import sqlite3
# Veritabanı İşleri
baglan = sqlite3.connect("veri.db")
veri = baglan.cursor()
#veri.execute("SELECT * FROM arkadaslar")
# Burayı verileri getirme olayını denemek için yaptım
def bul():
for listbox1 in veri.execute("SELECT * FROM arkadaslar"):
if listbox1[1] == giris.get():
print(listbox1)
baglan.commit()
# Obje Yaratma
pencere = Tk()
# Ana Özellikler
pencere.geometry("1200x600")
pencere.maxsize(1200, 600)
pencere.title("Furkan Private SM Database Systems")
# Resim ekleme Kısmı
arkaplan = PhotoImage(file = "bakim.png")
ikon = PhotoImage(file="isimsizlogo.png")
sorbuton = PhotoImage(file="button.png")
veriolustur = PhotoImage(file="dataolustur.png")
cikisdugmesi = PhotoImage(file="cikis.png")
# Arkaplan Resmi
anakatman = Label(pencere, image = arkaplan)
anakatman.place(x = -2, y = 0)
# Yazı Kısmı
etiket1= tkinter.Label(anakatman, text="Hoşgeldin Sahip..!", font="Xirod-Regular", fg="white", bg="#363636")
etiket1.place(y=255, x=460)
etiket2= tkinter.Label(anakatman, text="Sorgulanacak Kişi:", font="Xirod-Regular 10", fg="white", bg="#363636")
etiket2.place(y=330, x=503)
# Arama Çubuğu
giris = tkinter.Entry(pencere, bg="#e6c619",font="Arial 13" ,fg="black" ,bd=8,width=27)
giris.place(x=470, y=350)
# Butonlar
btn = tkinter.Button(pencere, height=30, width=30, bd=3 ,bg="#363636",image= sorbuton, activebackground="#e6c619", command=bul)
btn.place(x=735 ,y=350)
cikis = tkinter.Button(pencere, height=30, width=60, image=cikisdugmesi, bg="#363636", activebackground="#e6c619", command=pencere.quit)
cikis.place(x=580, y=480)
veributon = tkinter.Button(pencere,height=30, width=200, image=veriolustur,bg="#363636", activebackground="#e6c619")
veributon.place(x=510, y=430)
# Sorguları Listeleyeceğim Alan
listbox1 = tkinter.Listbox(pencere, height=15, width=30)
listbox1.place(x=250, y=300)
# Pencere Üst İkonu
pencere.iconphoto(False, ikon)
# Döngü
pencere.mainloop()[/CODE]
Yapmayı istediğim şeyin fotoğrafı ektedir.
Sorgulama olayını çözdüm isim yazdığımda veriyi çekebiliyorum ama pycharm ın shell ekranında gözüküyor veriler. Ben bu verileri her biri ayrı bir listbox (ya da entry veya textbox hangisine olursa) yazdırmak istiyorum bir türlü beceremedim. Yardımcı olur musunuz?
[CODE title="Kodlarım"]# Import module
import tkinter
from tkinter import *
from tkinter.ttk import *
import sqlite3
# Veritabanı İşleri
baglan = sqlite3.connect("veri.db")
veri = baglan.cursor()
#veri.execute("SELECT * FROM arkadaslar")
# Burayı verileri getirme olayını denemek için yaptım
def bul():
for listbox1 in veri.execute("SELECT * FROM arkadaslar"):
if listbox1[1] == giris.get():
print(listbox1)
baglan.commit()
# Obje Yaratma
pencere = Tk()
# Ana Özellikler
pencere.geometry("1200x600")
pencere.maxsize(1200, 600)
pencere.title("Furkan Private SM Database Systems")
# Resim ekleme Kısmı
arkaplan = PhotoImage(file = "bakim.png")
ikon = PhotoImage(file="isimsizlogo.png")
sorbuton = PhotoImage(file="button.png")
veriolustur = PhotoImage(file="dataolustur.png")
cikisdugmesi = PhotoImage(file="cikis.png")
# Arkaplan Resmi
anakatman = Label(pencere, image = arkaplan)
anakatman.place(x = -2, y = 0)
# Yazı Kısmı
etiket1= tkinter.Label(anakatman, text="Hoşgeldin Sahip..!", font="Xirod-Regular", fg="white", bg="#363636")
etiket1.place(y=255, x=460)
etiket2= tkinter.Label(anakatman, text="Sorgulanacak Kişi:", font="Xirod-Regular 10", fg="white", bg="#363636")
etiket2.place(y=330, x=503)
# Arama Çubuğu
giris = tkinter.Entry(pencere, bg="#e6c619",font="Arial 13" ,fg="black" ,bd=8,width=27)
giris.place(x=470, y=350)
# Butonlar
btn = tkinter.Button(pencere, height=30, width=30, bd=3 ,bg="#363636",image= sorbuton, activebackground="#e6c619", command=bul)
btn.place(x=735 ,y=350)
cikis = tkinter.Button(pencere, height=30, width=60, image=cikisdugmesi, bg="#363636", activebackground="#e6c619", command=pencere.quit)
cikis.place(x=580, y=480)
veributon = tkinter.Button(pencere,height=30, width=200, image=veriolustur,bg="#363636", activebackground="#e6c619")
veributon.place(x=510, y=430)
# Sorguları Listeleyeceğim Alan
listbox1 = tkinter.Listbox(pencere, height=15, width=30)
listbox1.place(x=250, y=300)
# Pencere Üst İkonu
pencere.iconphoto(False, ikon)
# Döngü
pencere.mainloop()[/CODE]
Yapmayı istediğim şeyin fotoğrafı ektedir.