PDA

Visualizza la versione completa : [python]sys.exit


gandalf45
19-02-2003, 12:50
usando il comando sys.exit il programma mi da un errore di applicazione dicendo che:"un istruzione ha fatto riferimento alla memoria 0x0000000.La memoria non poteva essere read."
Uso python2.2 su windows Xp
su windows 98 e Me lo stesso programma gira perfettamente.
Qualcuno mi puņ aiutare???

gandalf45
20-02-2003, 13:14
posto il sorgente, nn so se puņ aiutare...

---Python---
from Tkinter import *
import sys,tkMessageBox,tkSimpleDialog,shelve

class ElencaLett(tkSimpleDialog.Dialog):
def body(self,ROOT):
Font=Rubrica.Font
Label(ROOT,text="Lettera:",font=Font).grid(row=0,column=0)
self.A=Entry(ROOT,font=Font)
self.A.grid(row=0,column=1,columnspan=2,sticky=E+W )
def apply(self):
ElencaLett.Nome=self.A.get()

class Modifica(tkSimpleDialog.Dialog):
def body(self,ROOT):
Font=Rubrica.Font
self.A=Entry(ROOT,font=Font)
self.A.grid(row=0,column=1,columnspan=2,sticky=E+W )
def apply(self):
Modifica.Nome=self.A.get()

class ModificaN(tkSimpleDialog.Dialog):
def body(self,ROOT):
Font=Rubrica.Font
self.E=Text(ROOT,height=6,width=30,font=Font)
self.E.grid()
def apply(self):
ModificaN.Nome=self.E.get("1.0",END)

class ModificaG(tkSimpleDialog.Dialog):
def body(self,ROOT):
Font=Rubrica.Font
self.D = Listbox(ROOT,height=5)
for item in ["Collaboratore", "Informatico", "Docente", "Consulente","Altro"]:
self.D.insert(END, item)
self.D.select_set(0)
self.D.pack()
def apply(self):
Gruppo=self.D.curselection()
try:
Gruppo=self.D.get(Gruppo)
except:
Gruppo="Altro"
ModificaG.Nome=Gruppo


class Aggiungi(tkSimpleDialog.Dialog):
def body(self,ROOT):
Font=Rubrica.Font
Label(ROOT,text="Nome:",font=Font).grid(row=0,column=0,sticky=W)
Label(ROOT,text="Cognome:",font=Font).grid(row=1,column=0,sticky=W)
Label(ROOT,text="E-Mail:",font=Font).grid(row=2,column=0,sticky=W)
Label(ROOT,text="Tel Casa:",font=Font).grid(row=3,column=0,sticky=W)
Label(ROOT,text="Tel Uff.:",font=Font).grid(row=4,column=0,sticky=W)
Label(ROOT,text="Tel Cell:",font=Font).grid(row=5,column=0,sticky=W)
Label(ROOT,text="Tel Fax:",font=Font).grid(row=6,column=0,sticky=W)
Label(ROOT,text="Gruppo:",font=Font).grid(row=7,column=0,sticky=W)
Label(ROOT,text="Note:",font=Font).grid(row=8,column=0,sticky=W)
self.A=Entry(ROOT,font=Font)
self.B=Entry(ROOT,font=Font)
self.C=Entry(ROOT,font=Font)
self.Tc=Entry(ROOT,font=Font)
self.Tu=Entry(ROOT,font=Font)
self.TCe=Entry(ROOT,font=Font)
self.TF=Entry(ROOT,font=Font)
self.C=Entry(ROOT,font=Font)
self.D = Listbox(ROOT,height=5)
for item in ["Collaboratore", "Informatico", "Docente", "Consulente","Altro"]:
self.D.insert(END, item)
self.D.select_set(0)
self.E=Text(ROOT,height=6,width=30,font=Font)
self.A.grid(row=0,column=1,columnspan=2,sticky=E+W )
self.B.grid(row=1,column=1,sticky=E+W)
self.C.grid(row=2,column=1,sticky=E+W)
self.Tc.grid(row=3,column=1,sticky=E+W)
self.Tu.grid(row=4,column=1,sticky=E+W)
self.TCe.grid(row=5,column=1,sticky=E+W)
self.TF.grid(row=6,column=1,sticky=E+W)
self.D.grid(row=7,column=1,sticky=E+W)
self.E.grid(row=8,column=1,sticky=E+W)
return self.A
def apply(self):
if self.A.get()=="":
return
Aggiungi.Nome=self.A.get()
Aggiungi.Cognome=self.B.get()
Aggiungi._Mail=self.C.get()
Aggiungi.Tel_Casa=self.Tc.get()
Aggiungi.Tel_Uff=self.Tu.get()
Aggiungi.Tel_Cell=self.TCe.get()
Aggiungi.Tel_Fax=self.TF.get()
Aggiungi.Gruppo=self.D.curselection()
try:
Aggiungi.Gruppo=self.D.get(Aggiungi.Gruppo)
Gruppo=Aggiungi.Gruppo
except:
Gruppo="Altro"
Aggiungi.Gruppo=Gruppo
Aggiungi.Note=self.E.get("1.0",END)

class FormatFont(tkSimpleDialog.Dialog):
def body(self,ROOT):
self.FFont=StringVar()
self.Size=IntVar()
Font=Rubrica.Font
self.Font=Font
self.FFont.set(Font[0])
self.Size.set(Font[1])
#self.Font=("Comic Sans MS",10)
Radiobutton(ROOT, text="Comic Sans MS", variable=self.FFont,\
value="Comic Sans MS",font=("Comic Sans MS",10)).grid(row=0,column=0,sticky=W)
Radiobutton(ROOT, text="Times New Roman", variable=self.FFont,\
value="Times New Roman",font=("Times New Roman",10)).grid(row=1,column=0,sticky=W)
Radiobutton(ROOT, text="Impact", variable=self.FFont,\
value="Impact",font=("Impact",10)).grid(row=2,column=0,sticky=W)
Radiobutton(ROOT, text="Tahoma", variable=self.FFont,\
value="Tahoma",font=("Tahoma",10)).grid(row=3,column=0,sticky=W)
Radiobutton(ROOT, text="Arial", variable=self.FFont,\
value="Arial",font=("Arial",10)).grid(row=4,column=0,sticky=W)
Radiobutton(ROOT, text="Westminster", variable=self.FFont,\
value="Westminster",font=("Westminster",10)).grid(row=5,column=0,sticky=W)
Radiobutton(ROOT, text="8", variable=self.Size,value=8).grid(row=0,column=1,st icky=W)
Radiobutton(ROOT, text="10", variable=self.Size,value=10).grid(row=1,column=1,s ticky=W)
Radiobutton(ROOT, text="12", variable=self.Size,value=12).grid(row=2,column=1,s ticky=W)
Radiobutton(ROOT, text="14", variable=self.Size,value=14).grid(row=3,column=1,s ticky=W)
def apply(self):
self.Font=(self.FFont.get(),self.Size.get())
print self.Font


class Rubrica:
def __init__(self):
FormatFont.Font=("Times New Roman",10)
self.Database=shelve.open("Database","c")
self.CreaGrafica(FormatFont.Font,0)
def CreaGrafica(self,Font,n):
if n==0:
self.ROOT=Tk()
self.ROOT.title("Rubrica")
self.ROOT.bind("<Escape>", self.Esci)
elif n==1:
self.TopLFrame.destroy()
#La finistra grafica vera e propria
Rubrica.Font=Font
#Un frame che contiene gli altri
self.TopLFrame=Frame(self.ROOT)
self.TopLFrame.pack(anchor=W)
#3 frame iniziali
MenuFrame=Frame(self.TopLFrame)
MenuFrame.pack(side=TOP,fill=X,anchor=N)#Menu messo in alto
MainFrame=Frame(self.TopLFrame)
MainFrame.pack(side=TOP,anchor=W)#Finestra principale, sotto il menu
FrameSinistra=Frame(MainFrame,height=480,relief='r idge')
FrameSinistra.pack(side=LEFT)#Frame di sinistra
FrameDestra=Frame(MainFrame,width=640)
FrameDestra.pack(side=TOP)#Email e descrizione
#-------------------------------------#
#Menu file
FileMenuBTN=Menubutton(MenuFrame,text="File",underline=0,font=Font)
FileMenuBTN.pack(side=LEFT)
FileMenu=Menu(FileMenuBTN,tearoff=0)
FileMenu.add_command(label="Aggiungi",underline=0,command=self.Aggiungi,font=Font)
FileMenu.add_separator()
FileMenu.add_command(label="Exit",underline=0,command=sys.exit,font=Font)
FileMenuBTN["menu"]=FileMenu
#-------------------------------------#
#Menu Opzioni
OptionMenuBTN=Menubutton(MenuFrame,text="Opzioni",underline=0,font=Font)
OptionMenu=Menu(OptionMenuBTN,tearoff=0)
OptionMenu.add_command(label="Font",underline=0,command=self.Fonts,font=Font)
OptionMenuBTN["menu"]=OptionMenu
OptionMenuBTN.pack(side=LEFT,anchor=W)
#-------------------------------------#
#Menu Help
HelpMenuBTN=Menubutton(MenuFrame,text="?",underline=0,font=Font)
HelpMenu=Menu(HelpMenuBTN,tearoff=0)
HelpMenu.add_command(label="INFO & Help ",underline=0,command=self.Info,font=Font)
HelpMenuBTN["menu"]=HelpMenu
HelpMenuBTN.pack(side=LEFT,anchor=W)
#-------------------------------------#
#MenuFrame finito!
#Avanti con il FrameSinistra!
#-------------------------------------#
#FrameDestra
FrDstr_A=Frame(FrameDestra)
FrDstr_A.pack(side=TOP)
self.FrDstr_B=Frame(FrameDestra)
self.FrDstr_B.pack(side=TOP)
self.CreaFrabeB_a()
Label(FrDstr_A,text="Nome:",font=Font).grid(row=0,column=0)
Label(FrDstr_A,text="Cognome:",font=Font).grid(row=1,column=0)
Label(FrDstr_A,text="E-Mail:",font=Font).grid(row=2,column=0)
Label(FrDstr_A,text="Gruppo:",font=Font).grid(row=3,column=0)
self.A=Entry(FrDstr_A,font=Font)
self.B=Entry(FrDstr_A,font=Font)
self.C=Entry(FrDstr_A,font=Font)
self.D = Listbox(FrDstr_A,height=5)
for item in ["Collaboratore", "Informatico", "Docente", "Consulente","Altro"]:
self.D.insert(END, item)
self.D.select_set(0)
self.A.grid(row=0,column=1,sticky=E+W)
self.B.grid(row=1,column=1,sticky=E+W)
self.C.grid(row=2,column=1,sticky=E+W)
self.D.grid(row=3,column=1,sticky=E+W)
Button(FrDstr_A,text="Cerca per Nome",font=Font,command=self.CercaNome).grid(row=0,colu mn=2,sticky=E+W)
Button(FrDstr_A,text="Cerca per Cognome",font=Font,command=self.CercaCognome).grid(row=1,c olumn=2,sticky=E+W)
Button(FrDstr_A,text="Cerca per E-Mail",font=Font,command=self.CercaEMail).grid(row=2,col umn=2,sticky=E+W)
Button(FrDstr_A,text="Cerca per Gruppo",font=Font,command=self.CercaGruppo).grid(row=3,co lumn=2,sticky=NE+SW)
Button(FrDstr_A,text="Cerca per \nNome e Cognome",font=Font,command=self.CercaNeC).grid(row=0,colum n=3,rowspan=2,sticky=NE+SW)
Button(FrDstr_A,text="Elenca per lettera(Nome)...",font=Font,command=self.ElencaLN).grid(sticky=NE+S W,row=4,columnspan=3,column=0)
Button(FrDstr_A,text="Elenca per lettera(Cognome)...",font=Font,command=self.ElencaLC).grid(sticky=NE+S W,row=5,columnspan=3,column=0)
self.ROOT.mainloop()
def Temp(self):
print 'ok'

gandalf45
20-02-2003, 13:16
def Aggiungi(self):
EMaiL=""
aAggiungi=Aggiungi(self.ROOT,"Aggiungi")
try:
Nome=aAggiungi.Nome
except:
return
try:
Cognome=aAggiungi.Cognome
except:
Cognome=" "
try:
E_Mail=aAggiungi._Mail
except:
E_Mail=" "
try:
Tel_Casa=Aggiungi.Tel_Casa
except:
Tel_Casa=" "
try:
Tel_Uff=Aggiungi.Tel_Uff
except:
Tel_Uff=" "
try:
Tel_Cell=Aggiungi.Tel_Cell
except:
Tel_Cell=" "
try:
Tel_Fax=Aggiungi.Tel_Fax
except:
Tel_Fax=Aggiungi.Tel_Fax
Gruppo=aAggiungi.Gruppo
Note=aAggiungi.Note
MAILOK=tkMessageBox.askyesno("Rubrica:",Nome+" "+Cognome+" "+E_Mail+" "+Gruppo+",\nva bene?")
if MAILOK==1:
self.Database[Nome+" "+Cognome]=[Nome,Cognome,E_Mail,Gruppo,Tel_Casa,Tel_Uff,Tel_Ce ll,Tel_Fax,Note]
self.Database.close()
self.Database=shelve.open("Database","c")
def CercaNome(self):
a=self.A.get()
Ok=0
Lista={}
for x in self.Database.keys():
y=self.Database[x][0]
if y==a:
Ok=1
Voce=x+" "+self.Database[x][2]+" "+self.Database[x][3]+" "+self.Database[x][4]+" "+self.Database[x][5]
Lista[Voce]=x
if Ok==0:
tkMessageBox.showinfo("Rubrica...","Profilo non trovato")
else:
self.RubrList.destroy()
self.CL.destroy()
self.Scrl.destroy()
self.CreaFrabeB_a(Lista)
def CercaCognome(self):
a=self.B.get()
Ok=0
Lista={}
for x in self.Database.keys():
y=self.Database[x][1]
if y==a:
Ok=1
Voce=x+" "+self.Database[x][2]+" "+self.Database[x][3]+" "+self.Database[x][4]+" "+self.Database[x][5]
Lista[Voce]=x
if Ok==0:
tkMessageBox.showinfo("Rubrica...","Profilo non trovato")
else:
self.CL.destroy()
self.RubrList.destroy()
self.Scrl.destroy()
self.CreaFrabeB_a(Lista)
def CercaNeC(self):
a=self.A.get()
b=self.B.get()
c=a+" "+b
Ok=0
Lista={}
for x in self.Database.keys():
y=x
if y==c:
Ok=1
Voce=x+" "+self.Database[x][2]+" "+self.Database[x][3]+" "+self.Database[x][4]+" "+self.Database[x][5]
Lista[Voce]=x
if Ok==0:
tkMessageBox.showinfo("Rubrica...","Profilo non trovato")
else:
self.RubrList.destroy()
self.CL.destroy()
self.Scrl.destroy()
self.CreaFrabeB_a(Lista)
def CercaEMail(self):
a=self.C.get()
Ok=0
Lista={}
for x in self.Database.keys():
y=self.Database[x][2]
if y==a:
Ok=1
Voce=x+" "+self.Database[x][2]+" "+self.Database[x][3]+" "+self.Database[x][4]+" "+self.Database[x][5]
Lista[Voce]=x
if Ok==0:
tkMessageBox.showinfo("Rubrica...","Profilo non trovato")
else:
self.RubrList.destroy()
self.CL.destroy()
self.Scrl.destroy()
self.CreaFrabeB_a(Lista)
def CercaGruppo(self):
a=self.D.curselection()
try:
a=self.D.get(a)
except:
a="Altro"
Ok=0
Lista={}
for x in self.Database.keys():
y=self.Database[x][3]
if y==a:
Ok=1
Voce=x+" "+self.Database[x][2]+" "+self.Database[x][3]+" "+self.Database[x][4]+" "+self.Database[x][5]
Lista[Voce]=x
if Ok==0:
tkMessageBox.showinfo("Rubrica...","Profilo non trovato")
else:
self.RubrList.destroy()
self.CL.destroy()
self.Scrl.destroy()
self.CreaFrabeB_a(Lista)
def ElencaLN(self):
ElencaLett(self.ROOT,"Elenca per lettera...")
try:
a=ElencaLett.Nome
except:
return
Ok=0
Lista={}
for x in self.Database.keys():
y=x[0]
if y==a:
Ok=1
Voce=x+" "+self.Database[x][2]+" "+self.Database[x][3]+" "+self.Database[x][4]+" "+self.Database[x][5]
Lista[Voce]=x
if Ok==0:
tkMessageBox.showinfo("Rubrica...","Profilo non trovato")
else:
self.RubrList.destroy()
self.CL.destroy()
self.Scrl.destroy()
self.CreaFrabeB_a(Lista)
def ElencaLC(self):
ElencaLett(self.ROOT,"Elenca per lettera...")
try:
a=ElencaLett.Nome
except:
return
Ok=0
Lista={}
for x in self.Database.keys():
y=(self.Database[x][1])
if y[0]==a:
Ok=1
Voce=x+" "+self.Database[x][2]+" "+self.Database[x][3]+" "+self.Database[x][4]+" "+self.Database[x][5]
Lista[Voce]=x
if Ok==0:
tkMessageBox.showinfo("Rubrica...","Profilo non trovato")
else:
self.RubrList.destroy()
self.CL.destroy()
self.Scrl.destroy()
self.CreaFrabeB_a(Lista)
def CreaFrabeB_a(self,Lista={}):
Font=Rubrica.Font
self.Lista=Lista
CL=Button(self.FrDstr_B,text="Crea File",command=self.CreaFile)
CL.pack(side=BOTTOM,fill=BOTH)
self.CL=CL
self.RubrList = Listbox(self.FrDstr_B,height=16,width=70,font=Font )
for item in self.Lista.keys():
self.RubrList.insert(END, item)
self.RubrList.pack(side=LEFT,fill=BOTH)
self.RubrList.bind("<Double-Button-1>", self.Scheda)
self.Scrl=Scrollbar(self.FrDstr_B)
self.Scrl.pack(side=LEFT,fill=Y)
self.Scrl["command"]=self.RubrList.yview
self.RubrList['yscrollcommand']=self.Scrl.set
def Fonts(self):
FFont=FormatFont(self.ROOT,"Font Type")
self.CreaGrafica(FFont.Font,1)
def Esci(self,x=1):
sys.exit(1)

gandalf45
20-02-2003, 13:19
def CreaFile(self):
Elenco=open("Elenco.html",W)
Elenco.write("<html><body>")
Elenco.write("<TABLE BORDER=1 CELLPADDING=2 CELLSPACING=2><TR><TD WIDTH=12%>Nome</TD>\
<TD WIDTH=12%>Cognome</TD><TD WIDTH=12%>E-Mail</TD><TD WIDTH=12%>Gruppo</TD><TD WIDTH=12%>Tel Casa</TD>\
<TD WIDTH=12%>Tel Uff</TD><TD WIDTH=12%>Tel Cell</TD><TD WIDTH=12%>Tel Fax</TD><TD WIDTH=12%>Note</TD></TR>")
for x in self.Lista:
y=self.Lista[x]
Elenco.write("<TR>")
for z in range(9):
El=self.Database[y][z]
if El=="":
El="//"
elif El=="\n":
El="//"
Elenco.write("<TD ALIGN=CENTER>%s</TD>" %(El))
Elenco.write("</TR>")
def Info(self):
tkMessageBox.showinfo("Help","Questa č una rubrica realizzata con Tkinter(Python).\n"
"Cliccando con il destro su un E-Mail la si puņ modificare o cancellare.\n"
"Maggiori infomazioni nel readme.")
def Scheda(self,Event):
a=self.RubrList.curselection()
b=self.RubrList.get(a)
c=self.Lista[b]
self.c=c
InfoUT=Toplevel(self.ROOT)
Font=Rubrica.Font
self.InfoUT=InfoUT
Label(InfoUT,text="Nome:",font=Font).grid(row=0,column=0,sticky=NE+SW)
Label(InfoUT,text="Cognome:",font=Font).grid(row=1,column=0,sticky=NE+SW)
Label(InfoUT,text="E-Mail:",font=Font).grid(row=2,column=0,sticky=NE+SW)
Label(InfoUT,text="Tel Casa:",font=Font).grid(row=3,column=0,sticky=W)
Label(InfoUT,text="Tel Uff.:",font=Font).grid(row=4,column=0,sticky=W)
Label(InfoUT,text="Tel Cell:",font=Font).grid(row=5,column=0,sticky=W)
Label(InfoUT,text="Tel Fax:",font=Font).grid(row=6,column=0,sticky=W)
Label(InfoUT,text="Gruppo:",font=Font).grid(row=7,column=0,sticky=NE+SW)
Label(InfoUT,text="Note:",font=Font).grid(row=8,column=0,sticky=NE+SW)
Label(InfoUT,text=self.Database[c][0],relief='ridge',font=Font).grid(row=0,column=1,sti cky=NE+SW)#Nome
Label(InfoUT,text=self.Database[c][1],relief='ridge',font=Font).grid(row=1,column=1,sti cky=NE+SW)#Cognome
Label(InfoUT,text=self.Database[c][2],relief='ridge',font=Font).grid(row=2,column=1,sti cky=NE+SW)#email
Label(InfoUT,text=self.Database[c][4],relief='ridge',font=Font).grid(row=3,column=1,sti cky=NE+SW)#tel
Label(InfoUT,text=self.Database[c][5],relief='ridge',font=Font).grid(row=4,column=1,sti cky=NE+SW)#tel
Label(InfoUT,text=self.Database[c][6],relief='ridge',font=Font).grid(row=5,column=1,sti cky=NE+SW)#tel
Label(InfoUT,text=self.Database[c][7],relief='ridge',font=Font).grid(row=6,column=1,sti cky=NE+SW)#tel
Label(InfoUT,text=self.Database[c][3],relief='ridge',font=Font).grid(row=7,column=1,sti cky=NE+SW)#gruppo
Label(InfoUT,text=self.Database[c][8],height=6,width=30,relief='ridge',font=Font).grid( row=8,column=1,sticky=NE+SW)#note
Button(InfoUT,text="Ok",command=self.OK,font=Font).grid(row=9,column=0,st icky=NE+SW)
Button(InfoUT,text="Elimina Profilo",command=self.Elimina,font=Font).grid(row=9,column =1,sticky=NE+SW)
Button(InfoUT,text="Modifica",command=self.ModificaEM,font=Font).grid(row=2,col umn=2,sticky=NE+SW)#EMail
Button(InfoUT,text="Modifica",command=self.Modifica_TC,font=Font).grid(row=3,co lumn=2,sticky=NE+SW)#tel
Button(InfoUT,text="Modifica",command=self.Modifica_TU,font=Font).grid(row=4,co lumn=2,sticky=NE+SW)#tel
Button(InfoUT,text="Modifica",command=self.Modifica_TCE,font=Font).grid(row=5,c olumn=2,sticky=NE+SW)#tel
Button(InfoUT,text="Modifica",command=self.Modifica_TFX,font=Font).grid(row=6,c olumn=2,sticky=NE+SW)#tel
Button(InfoUT,text="Modifica",command=self.ModificaG,font=Font).grid(row=7,colu mn=2,sticky=NE+SW)#gruppo
Button(InfoUT,text="Modifica",command=self.ModificaN,font=Font).grid(row=8,colu mn=2,sticky=NE+SW)#note
Label(InfoUT,relief='ridge').grid(row=0,rowspan=2, column=2,sticky=NE+SW)
def Elimina(self):
del self.Database[self.c]
self.Database.close()
self.Database=shelve.open("Database","c")
self.InfoUT.destroy()
self.CL.destroy()
self.RubrList.destroy()
self.Scrl.destroy()
self.CreaFrabeB_a()
def CreaInfo(self):
c=self.c
InfoUT=Toplevel(self.ROOT)
Font=Rubrica.Font
self.InfoUT=InfoUT
Label(InfoUT,text="Nome:",font=Font).grid(row=0,column=0,sticky=NE+SW)
Label(InfoUT,text="Cognome:",font=Font).grid(row=1,column=0,sticky=NE+SW)
Label(InfoUT,text="E-Mail:",font=Font).grid(row=2,column=0,sticky=NE+SW)
Label(InfoUT,text="Tel Casa:",font=Font).grid(row=3,column=0,sticky=W)
Label(InfoUT,text="Tel Uff.:",font=Font).grid(row=4,column=0,sticky=W)
Label(InfoUT,text="Tel Cell:",font=Font).grid(row=5,column=0,sticky=W)
Label(InfoUT,text="Tel Fax:",font=Font).grid(row=6,column=0,sticky=W)
Label(InfoUT,text="Gruppo:",font=Font).grid(row=7,column=0,sticky=NE+SW)
Label(InfoUT,text="Note:",font=Font).grid(row=8,column=0,sticky=NE+SW)
Label(InfoUT,text=self.Database[c][0],relief='ridge',font=Font).grid(row=0,column=1,sti cky=NE+SW)#Nome
Label(InfoUT,text=self.Database[c][1],relief='ridge',font=Font).grid(row=1,column=1,sti cky=NE+SW)#Cognome
Label(InfoUT,text=self.Database[c][2],relief='ridge',font=Font).grid(row=2,column=1,sti cky=NE+SW)#email
Label(InfoUT,text=self.Database[c][4],relief='ridge',font=Font).grid(row=3,column=1,sti cky=NE+SW)#tel
Label(InfoUT,text=self.Database[c][5],relief='ridge',font=Font).grid(row=4,column=1,sti cky=NE+SW)#tel
Label(InfoUT,text=self.Database[c][6],relief='ridge',font=Font).grid(row=5,column=1,sti cky=NE+SW)#tel
Label(InfoUT,text=self.Database[c][7],relief='ridge',font=Font).grid(row=6,column=1,sti cky=NE+SW)#tel
Label(InfoUT,text=self.Database[c][3],relief='ridge',font=Font).grid(row=7,column=1,sti cky=NE+SW)#gruppo
Label(InfoUT,text=self.Database[c][8],height=6,width=30,relief='ridge',font=Font).grid( row=8,column=1,sticky=NE+SW)#note
Button(InfoUT,text="Ok",command=self.OK,font=Font).grid(row=9,column=0,st icky=NE+SW)
Button(InfoUT,text="Elimina Profilo",command=self.Elimina,font=Font).grid(row=9,column =1,sticky=NE+SW)
Button(InfoUT,text="Modifica",command=self.ModificaEM,font=Font).grid(row=2,col umn=2,sticky=NE+SW)#EMail
Button(InfoUT,text="Modifica",command=self.Modifica_TC,font=Font).grid(row=3,co lumn=2,sticky=NE+SW)#tel
Button(InfoUT,text="Modifica",command=self.Modifica_TU,font=Font).grid(row=4,co lumn=2,sticky=NE+SW)#tel
Button(InfoUT,text="Modifica",command=self.Modifica_TCE,font=Font).grid(row=5,c olumn=2,sticky=NE+SW)#tel
Button(InfoUT,text="Modifica",command=self.Modifica_TFX,font=Font).grid(row=6,c olumn=2,sticky=NE+SW)#tel
Button(InfoUT,text="Modifica",command=self.ModificaG,font=Font).grid(row=7,colu mn=2,sticky=NE+SW)#gruppo
Button(InfoUT,text="Modifica",command=self.ModificaN,font=Font).grid(row=8,colu mn=2,sticky=NE+SW)#note
Label(InfoUT,relief='ridge').grid(row=0,rowspan=2, column=2,sticky=NE+SW)
def ModificaEM(self):
Modifica(self.InfoUT,"Modifica...")
try:
a=Modifica.Nome
except:
return
self.InfoUT.destroy()
c=self.Database[self.c]
c[2]=a
self.Database[self.c]=c
self.Database.close()
self.Database=shelve.open("Database","c")
self.CreaInfo()
def Modifica_TC(self):
Modifica(self.InfoUT,"Modifica...")
try:
a=Modifica.Nome
except:
return
self.InfoUT.destroy()
c=self.Database[self.c]
c[4]=a
self.Database[self.c]=c
self.Database.close()
self.Database=shelve.open("Database","c")
self.CreaInfo()
def Modifica_TU(self):
Modifica(self.InfoUT,"Modifica...")
try:
a=Modifica.Nome
except:
return
self.InfoUT.destroy()
c=self.Database[self.c]
c[5]=a
self.Database[self.c]=c
self.Database.close()
self.Database=shelve.open("Database","c")
self.CreaInfo()
def Modifica_TCE(self):
Modifica(self.InfoUT,"Modifica...")
try:
a=Modifica.Nome
except:
return
self.InfoUT.destroy()
c=self.Database[self.c]
c[6]=a
self.Database[self.c]=c
self.Database.close()
self.Database=shelve.open("Database","c")
self.CreaInfo()
def Modifica_TFX(self):
Modifica(self.InfoUT,"Modifica...")
try:
a=Modifica.Nome
except:
return
self.InfoUT.destroy()
c=self.Database[self.c]
c[7]=a
self.Database[self.c]=c
self.Database.close()
self.Database=shelve.open("Database","c")
self.CreaInfo()
def ModificaG(self):
ModificaG(self.InfoUT,"Modifica Gruppo...")
try:
a=ModificaG.Nome
except:
return
self.InfoUT.destroy()
c=self.Database[self.c]
c[3]=a
self.Database[self.c]=c
self.Database.close()
self.Database=shelve.open("Database","c")
self.CreaInfo()
def ModificaN(self):
ModificaN(self.InfoUT,"Modifica Note...")
try:
a=ModificaN.Nome
except:
return
self.InfoUT.destroy()
c=self.Database[self.c]
c[8]=a
self.Database[self.c]=c
self.Database.close()
self.Database=shelve.open("Database","c")
self.CreaInfo()
def OK(self):
self.InfoUT.destroy()
self.RubrList.destroy()
self.CL.destroy()
self.Scrl.destroy()
self.CreaFrabeB_a()
Rubrica()

gandalf45
22-02-2003, 16:03
up

Loading