All pastes #168253 Raw Edit

Mine

public python v1 · immutable
·published 2006-09-12 20:58 UTC
rendered paste body
import MySQLdbfrom Tkinter import *# Kelime arayici fonksiyondef ara():    global imlec,e1    aranan = e1.get()    if(aranan == ""):        aranan = 'ceviz'    imlec.execute("SELECT * FROM sozluk_tr2en WHERE sozluk_tr2en_kelime = '"+ aranan +"' UNION SELECT * FROM sozluk_en2tr WHERE sozluk_en2tr_kelime = '"+aranan+"' ")    anlam =  str(imlec.fetchall()).split("'")[3]    if anlam:        sonuc.insert(END,anlam)    else:        sonuc.insert(END,"bulunamadi")try:    # mySQL baglantisi    db    = MySQLdb.connect("localhost", "root", "", "sozluk")    imlec = db.cursor()        # Turkce karakterler icin    imlec.execute("SET NAMES 'latin5'")    imlec.execute("SET CHARACTER SET latin5")    imlec.execute("SET COLLATION_CONNECTION = 'latin5_turkish_ci'")   except:    print 'mysql baglantisi yok'    sys.exit()    # degiskenlersonuclar  = list()i         = 0    # Tkinter on the fly!root = Tk()root.title(' PySozluk - ceviz.net ')  Label(root, text="Kelime").grid(row=0,column=1)b = Button(root, text="Bul", width=25, command=ara).grid(row=2,column=1)e1 = Entry(root,width=25)e1.grid(row=1, column=1)sonuc = Text(root,width=25,height=10)sonuc.grid(row=3,column=1)root.mainloop()