Mavzu: Hususiy klinika ma’lumotlar bazasini yaratish
Python dasturlash tili imkoniyatlari
Download 280.75 Kb.
|
Polikilinika
- Bu sahifa navigatsiya:
- Pythonning oziga xosligi
- Python dasturlash tilini o`rnatish. Agar siz biror GNU/Linux distributivini ishlatayotgan bolsangiz kop xollarda sizning tizimingizda python
Python dasturlash tili imkoniyatlari
Python – bu o'rganishga oson va shu bilan birga imkoniyatlari yuqori bo'lgan oz sonlik zamonaviy dasturlash tillari qatoriga kiradi. Python yuqori darajadagi ma'lumotlar strukturasi va oddiy lekin samarador obyektga yo'naltirilgan dasturlash uslublarini taqdim etadi. Pythonning o'ziga xosligi Oddiy, o'rganishga oson, sodda sintaksisga ega, dasturlashni boshlash uchun qulay, erkin va ochiq kodlik dasturiy ta'minot. Dasturni yozish davomida quyi darajadagi detallarni, misol uchun xotirani boshqarishni hisobga olish shart emas. Ko'plab platformalarda hech qanday o'zgartirishlarsiz ishlay oladi. Interpretatsiya(Интерпретируемый) qilinadigan til. Kengayishga (Расширяемый) moyil til. Agar dasturni biror joyini tezroq ishlashini xoxlasak shu qismni C yoki C++ dasturlash tillarida yozib keyin shu qismni python kodi orqali ishga tushirsa(chaqirsa) bo'ladi. Juda ham ko'p xilma-xil kutubxonalarga ega. xml/html fayllar bilan ishlash http so`rovlari bilan ishlash GUI(grafik interfeys) Web ssenariy tuzish FTP bilan ishlash Rasmli audio video fayllar bilan ishlash Robot texnikada Matematik va ilmiy hisoblashlarni programmalash Pythonni katta proyektlarda ishlatish mumkin. Chunki, uni chegarasi yo`q, imkoniyati yuqori. Shuningdek, u sodda va universalligi bilan programmalash tillari orasida eng yaxshisidir. Python dasturlash tilini o`rnatish. Agar siz biror GNU/Linux distributivini ishlatayotgan bo'lsangiz ko'p xollarda sizning tizimingizda python o'rnatilgan bo'ladi. Buni tekshirib ko'rish uchun terminalingizdan quyidagi buyruqni ishga tushirib ko'ring. python -V Agar sizda Python 3.4.3 yozuvi yoki shunga o'xshash yozuv hosil bo'lsa unda hammasi joyida. from tkinter import * from tkinter import ttk from tkinter.ttk import Combobox import tkinter.messagebox import sqlite3 window=Tk() window.geometry("1000x600+10+10") window.title("Xususiy Polikilinikia") window.resizable(False,False) sarlovha=Label(window,text="Polikilinka", font="verdana 14 bold") sarlovha.pack() def yangi(): ism=StringVar() fam=StringVar() bolim=StringVar() qabul=StringVar() winYangi=Toplevel(window) winYangi.title("Yangi Navbat") winYangi.geometry("400x350+10+10") ismLabel=Label(winYangi,text="Ism:") ismLabel.pack() ismEntry=Entry(winYangi,textvariable=ism) ismEntry.pack() famLabel = Label(winYangi, text="Familiya:") famLabel.pack() famEntry = Entry(winYangi,textvariable=fam) famEntry.pack() v=["LOR","Glaznoy","Jarroh","Terapiya","Terapevt","Pedyatrya","Kojinniy","Endagrinolog","Nervpatologok","Stamatologok","Infektsionniy"] def lam(e): bolim.set("LOR") bolimLabel=Label(winYangi,text="Qaysi bo'limga") bolimLabel.pack() comboBolim=Combobox(winYangi,values=v,textvariable=bolim) comboBolim.bind(" bolim.set("LOR") comboBolim.pack(pady=10) navbat="navbat" print(ism,fam,bolim,navbat) def qoy(): conn = sqlite3.connect("klinika.db") with conn: cursor = conn.cursor() yoz=cursor.execute("insert into royxat(ism,fam,bolim,qabul) values(?,?,?,?)",(ism.get(),fam.get(),bolim.get(),navbat)) if yoz: winYangi.destroy() tkinter.messagebox.showinfo("Navbatga yozildi","Navbatga qo'yildi") conn.commit() res = cursor.execute("select ism,fam,bolim,qabul from royxat where qabul='navbat' order by id asc") conn.commit() row = res.fetchall() tv.delete(*tv.get_children()) for i in row: tv.insert('', 'end', values=i) btn=Button(winYangi,text="Navbatga qo'yish",command=qoy) btn.pack(pady=10) winYangi.mainloop() def otdi(): global bosildimi if bosildimi==1: qator = tv.item(tv.focus()) bosildimi=0 ism=qator['values'][0] fam=qator['values'][1] bol=qator['values'][2] conn = sqlite3.connect("klinika.db") with conn: cursor = conn.cursor() res = cursor.execute("update royxat set qabul='qabul' where ism=? and fam=? and bolim=?",(ism,fam,bol)) conn.commit() tkinter.messagebox.showinfo("O'tdi","Qabulga o'tdi") conn = sqlite3.connect("klinika.db") res2 = cursor.execute("select ism,fam,bolim,qabul from royxat where qabul='navbat' order by id asc") conn.commit() row2 = res2.fetchall() tv.delete(*tv.get_children()) for i in row2: tv.insert('', 'end', values=i) else:
def qabullar(): conn = sqlite3.connect("klinika.db") with conn: cursor = conn.cursor() res = cursor.execute("select ism,fam,bolim,qabul from royxat where qabul='qabul' order by id asc") conn.commit() row = res.fetchall() tv.delete(*tv.get_children()) for i in row: tv.insert('', 'end', values=i) def navbatdagilar(): conn = sqlite3.connect("klinika.db") with conn: cursor = conn.cursor() res = cursor.execute("select ism,fam,bolim,qabul from royxat where qabul='navbat' order by id asc") conn.commit() row = res.fetchall() tv.delete(*tv.get_children()) for i in row: tv.insert('', 'end', values=i) frameMenu=Frame(window) btnNavbat=Button(frameMenu,text="Navbatdagilar",command=navbatdagilar) btnNavbat.pack(side=LEFT,padx=10) btnYangi=Button(frameMenu,text="Yangi Navbat", command=yangi) btnYangi.pack(side=LEFT,padx=10) btnOtdi=Button(frameMenu,text="Qabuldan o'tdi", command=otdi) btnOtdi.pack(side=LEFT,padx=10) btnQabullar=Button(frameMenu,text="Barcha qabullar", command=qabullar) btnQabullar.pack(side=LEFT,padx=10) frameMenu.pack() fram2=Frame(window) tv=ttk.Treeview(fram2,columns=(1,2,3,4),show="headings",height=25) tv.column(1,width=220,stretch=True) tv.column(2,width=220,stretch=True) tv.column(3,width=220,stretch=True) tv.column(4,width=220,stretch=True) tv.heading(1,text="Ism") tv.heading(2,text="Familiya") tv.heading(3,text="Bo'lim") tv.heading(4,text="qabul") bosildimi=0 def bosildi(event): global bosildimi bosildimi=1 tv.bind(' conn=sqlite3.connect("klinika.db") with conn: cursor=conn.cursor() res=cursor.execute("select ism,fam,bolim,qabul from royxat where qabul='navbat' order by id asc") conn.commit() row=res.fetchall() tv.delete(*tv.get_children()) for i in row: tv.insert('','end',values=i) tv.pack(fill=X,side=LEFT,padx=10) scrol=Scrollbar(fram2,orient=VERTICAL,relief=FLAT)
fram2.pack(fill=BOTH,padx=20,pady=20) window.mainloop()
Xulosa:
Loyihaning tub mohiyati shundan iboratki, ma’lumotlar bazasidan To’g’ri va qulay foydalanilsa har qanday ishdan foyda qoladi, vaqt tomonidan ham aniqlik tomonidan ham. Harqanday biznesda bu yutuqlarga olib keladi, hoh u klinika, hoh u ishlab chiqarish fabrikasi bo’lsin, farqi yo’q. Dasturdan foydalanilganda asosan sql sorvlardan va SQLite Browseridan foydalanildi. Download 280.75 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling