On Mon, Mar 21, 2011 at 1:58 AM, sihong lin <span dir="ltr">&lt;<a href="mailto:linsihong2003@yahoo.com">linsihong2003@yahoo.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">Hi, <br><br> I just write a simplest file test.py with only one line--print &quot;hello&quot;, when I run it in command line:<br>

&gt;&gt;&gt; python test.py<br><br>the follow message comes out:<br><br><span style="color: rgb(255, 0, 255);">File &quot;&lt;stdin&gt;&quot; , line 1</span><br style="color: rgb(255, 0, 255);"><span style="color: rgb(255, 0, 255);"> python test</span><br style="color: rgb(255, 0, 255);">

<br style="color: rgb(255, 0, 255);"><span style="color: rgb(255, 0, 255);">SyntaxError: invalid syntax</span><br style="color: rgb(255, 0, 255);"><br>but, the file can run in shell, also in the command line, I put<br><br>

&gt;&gt;&gt; print &quot;hello&quot;<br><br>output is fine, &quot;Hello&quot;<br></td></tr></tbody></table></blockquote><div><br>In the shell you can run shell commands, in the Python command line you can run Python code. &quot;python test.py&quot; is a shell command, not Python code, so you can run it in the shell, but not on the Python command line. &quot;print &quot;hello&quot;&quot; is Python code, so you can run it on the Python command line, but not in the shell. <br>

</div></div><br clear="all"><br>-- <br>André Engels, <a href="mailto:andreengels@gmail.com">andreengels@gmail.com</a><br><br>