James Darlack | 18 May 2011 16:30
Picon

Print does not work.

Hello,
 
I installed version 3.2 TK Version 8.5 on an XP system.  Simple commands such as a 1+1 and others work OK. However, when I enter print "hello/n", I get the error message.  I think there is a path or environmental name that is not set.  Can you advise me how to fix this problem?
 
>>> print "hello World!"
SyntaxError: invalid syntax
>>> python -v
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    python -v
NameError: name 'python' is not defined
>>> python -V
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    python -V
NameError: name 'python' is not defined

--
James (Jim) Darlack

_______________________________________________
IDLE-dev mailing list
IDLE-dev <at> python.org
http://mail.python.org/mailman/listinfo/idle-dev
Corey Richardson | 23 May 2011 04:40
Gravatar

Re: Print does not work.


On 05/18/2011 10:30 AM, James Darlack wrote:
> Hello,
> 
> I installed version 3.2 TK Version 8.5 on an XP system.  Simple commands
> such as a 1+1 and others work OK. However, when I enter print "hello/n", I
> get the error message.  I think there is a path or environmental name that
> is not set.  Can you advise me how to fix this problem?
> 
>>>> print "hello World!"
> SyntaxError: invalid syntax
>>>> python -v
> Traceback (most recent call last):
>   File "<pyshell#5>", line 1, in <module>
>     python -v
> NameError: name 'python' is not defined
>>>> python -V
> Traceback (most recent call last):
>   File "<pyshell#6>", line 1, in <module>
>     python -V
> NameError: name 'python' is not defined

Alright, you have two problems, none of them related to IDLE. First off,
the syntax for print in python 3 is print(string). Second, you were
trying to run shell commands from IDLE's python interpreter, which
doesn't work. You may be interested in the tutor list (tutor <at> python.org)
for basic questions.
--

-- 
Corey Richardson

Gmane