<div class="gmail_quote">2009/3/17 nuvolare <span dir="ltr"><<a href="mailto:nuvolare@email.it">nuvolare@email.it</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div><span class="Apple-style-span" style="font-family: 'Trebuchet MS'; font-size: 10px; font-weight: bold; ">Codice:</span><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:14px;background-color:rgb(221, 221, 221)">
<font face="Courier New" size="3" style="font:11.0px Courier New">>>> Stampa2Volte('Pippo')</font></div><div class="im"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:14px;background-color:rgb(221, 221, 221)">
<font face="Courier New" size="3" style="font:11.0px Courier New">Traceback (most recent call last):</font></div></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:14px;background-color:rgb(221, 221, 221)">
<font face="Courier New" size="3" style="font:11.0px Courier New"> File "<pyshell#0>", line 1, in <module></font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:14px;background-color:rgb(221, 221, 221)">
<font face="Courier New" size="3" style="font:11.0px Courier New"> Stampa2Volte('Pippo')</font></div><div class="im"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:14px;background-color:rgb(221, 221, 221)">
<font face="Courier New" size="3" style="font:11.0px Courier New">NameError: name 'Stampa2Volte' is not defined</font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:14px;background-color:rgb(221, 221, 221)">
<font face="Courier New" size="3" style="font:11.0px Courier New">>>></font></div></div></div></div></blockquote><div><br></div><div>Prima di chiamare una funzione hai bisogno di definirla.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div class="im"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:16px;min-height:15px"><span class="Apple-style-span" style="font-family: 'Trebuchet MS'; line-height: normal; ">Se lo faccio da IDLE mi dice</span><br>
</div></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:12px"><font face="Trebuchet MS" size="2" style="font:10.0px Trebuchet MS"><b>Codice:</b></font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:14px;background-color:rgb(221, 221, 221)">
<font face="Courier New" size="3" style="font:11.0px Courier New">>>> print "Pippo",</font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:14px;background-color:rgb(221, 221, 221)">
<font face="Courier New" size="3" style="font:11.0px Courier New">SyntaxError: invalid syntax (<pyshell#16>, line 1)</font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:14px;background-color:rgb(221, 221, 221)">
<font face="Courier New" size="3" style="font:11.0px Courier New">>>></font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:16px;min-height:15px"></div></div></div>
</blockquote><div><br></div><div>Nella shell di Python stai usando Python 2.5, mentre da IDLE usi Python 3.0. In quest'ultimo, print diventa una funzione per cui hai bisogno delle parentesi:</div><div><br></div><div>>> print("Pippo")</div>
<div><br></div><div>Usa Python 2.5 per ora. Poi quando conosci Python, puoi passare a studiarti Python 3.0 (passerą qualche annetto prima di diventare la versione pił usata).</div><div>Se vuoi una shell avanzata, installati iPython: <a href="http://ipython.scipy.org/moin/">http://ipython.scipy.org/moin/</a></div>
<div><br></div><div>Ciao,</div><div>Antonio</div><div>-- <br></div></div><a href="http://antoniocangiano.com">http://antoniocangiano.com</a> - Zen and the Art of Programming<br><a href="http://math-blog.com">http://math-blog.com</a> - Mathematics is wonderful!<br>
<a href="http://stacktrace.it">http://stacktrace.it</a> - Aperiodico di resistenza informatica<br>Follow me on Twitter: <a href="http://twitter.com/acangiano">http://twitter.com/acangiano</a><br>Author of "Ruby on Rails for Microsoft Developers" (Wrox, 2009)<br>