<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19412">
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT size=2 face=Arial>From: "Marco De Paoli" <</FONT><A 
href="mailto:depaolim@gmail.com"><FONT size=2 
face=Arial>depaolim@gmail.com</FONT></A><FONT size=2 
face=Arial>></FONT></DIV>
<DIV><FONT size=2 face=Arial>Ciao Gabriel,<BR>si è persa tutta la formattazione 
della tua sessione su pdb, in particolare<BR>si sono persi tutti gli 
a-capo<BR></FONT></DIV>
<DIV><FONT size=2 face=Arial>GB: Auch... Eppure mentre editavo la mail, tutti 
gli a capo c'erano e la formattazione era corretta... Perchè quando poi viene 
inviata, succede questo casino?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>In primis, grazie per il suggerimento del 
set_trace() nel codice, lo proverò, ma vorrei poterne seguire l'esecuzione 
proprio dall'inizio. Come si inserisce un break point?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Ora provo a rimandare la mia precedente mail, 
camiando un'opzione d'invio nel mailer, vediamo se questa volta riesco a 
mantenere la formattazione originale.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>***</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman">Buongiorno.<BR><BR>Questa mattina cerco di fare amicizia 
con lo strumento in oggetto. Ecco come sta procedendo il mio 
approccio.<BR><BR>Da, </FONT><A 
href="http://docs.python.it/html/lib/module-pdb.html"><FONT size=3 
face="Times New Roman">http://docs.python.it/html/lib/module-pdb.html</FONT></A><FONT 
size=3 face="Times New Roman"> leggo:<BR>"<BR>Il prompt del debugger è "(Pdb) ". 
L'utilizzo tipico di questo modulo per eseguire un programma sotto il controllo 
del debugger è:<BR><BR><BR>>>> import pdb<BR>>>> import 
mymodule<BR>>>> pdb.run('mymodule.test()')<BR>> 
<string>(0)?()<BR>(Pdb) continue<BR>> <string>(1)?()<BR>(Pdb) 
continue<BR>NameError: 'spam'<BR>> 
<string>(1)?()<BR>(Pdb)<BR></FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">"Apro dunque 
l'interprete:</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman">>>></FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">Importo 
PDB:</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman"></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">>>> 
import pdb</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman">>>></FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">Importo il mio 
modulo:</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">>>> 
import batnav</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">Il modulo 
parte, lo uso finchè non <BR>lo porto ad un crash</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">"Traceback 
(most recent call last):</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">File 
"<stdin>", line 1, in <module></FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">File 
"batnav.py", line 350, in <module> </FONT></FONT><FONT size=2 
face=Arial><FONT size=3 face="Times New Roman">AzioniColpo()</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">File 
"batnav.py", line 275, in AzioniColpo </FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman">Affonda()</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">File 
"batnav.py", line 41, in Affonda</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">  del 
Navi[Navi.index(LN)]</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">ValueError: 1 
is not in list</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman">>>></FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman"> "A questo 
punto... Penso di aver capito di dover invocare la funzione pm del <BR>modulo 
pdb, è giusto?</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman"></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">>>> 
pdb.pm()</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">"> 
c:\python27\gb\batnav.py</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman">(41)Affonda()</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">-> del 
Navi[Navi.index(LN)]</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman">(Pdb)</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman"> "A questo 
punto vorrei vedere il valore che ha causato l'out of index. In questo caso è 
stato riportato dal Traceback e so già che è 1, ma giusto per 
<BR>imparare.</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">(Pdb) 
LN</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">(Pdb) 
</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">Perchè? Non 
dovrebbe rispondere 1?</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">Provo 
pp:</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman"></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">(Pdb) pp 
LN</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman">None</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 
face="Times New Roman">(Pdb)</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">Uhm, sono un po 
confuso, ma LN non era la causa del crash?</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">Ok, come faccio 
invece, se volessi testare il funzionamento di batnav.py sin dalla sua prima 
istruzione, non post_mortem. Come <BR>faccio a caricarlo nell'interprete senza 
che venga eseguito in automatico?Consapevole dell'ingenuità di queste domande, 
resto in <BR>attesa di qualche spunto...</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">Come sempre 
grazie per la vostra gentilezza e pazienza.</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">G. 
</FONT><BR>***</FONT></DIV></BODY></HTML>