<div class="gmail_quote">2009/3/17 nuvolare <span dir="ltr">&lt;<a href="mailto:nuvolare@email.it">nuvolare@email.it</a>&gt;</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: &#39;Trebuchet MS&#39;; 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">&gt;&gt;&gt; Stampa2Volte(&#39;Pippo&#39;)</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 &quot;&lt;pyshell#0&gt;&quot;, line 1, in &lt;module&gt;</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(&#39;Pippo&#39;)</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 &#39;Stampa2Volte&#39; 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">&gt;&gt;&gt;</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: &#39;Trebuchet MS&#39;; 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">&gt;&gt;&gt; print &quot;Pippo&quot;,</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 (&lt;pyshell#16&gt;, 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">&gt;&gt;&gt;</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&#39;ultimo, print diventa una funzione per cui hai bisogno delle parentesi:</div><div><br></div><div>&gt;&gt; print(&quot;Pippo&quot;)</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 &quot;Ruby on Rails for Microsoft Developers&quot; (Wrox, 2009)<br>