Print does not work.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Print does not work.

James Darlack
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
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Print does not work.

Corey Richardson
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 ([hidden email])
for basic questions.
- --
Corey Richardson
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQEcBAEBAgAGBQJN2ckeAAoJEAFAbo/KNFvphwMIAI4H4fy0W3hZW1YQtvnoC8/O
wmJeOvc+GnXVgfdn3+QPfPJhEQJOKcKFnquF/BSdT9prnXPaoNreJCl/EF/H3xba
JMKXQL2xkdRAwDUDrgw0a1g6BDMDBqGxmbG1rr49JW1JoXIKfcsL+tngYB1tBGT2
B6eOQL2z9Bj/aBEBsgXFYhO3RnkdqQHMTtRCNzJEtaibDFfIdiSyzQI7QmUYpcFq
K6RHPQpsSSW8yCVlkVdjJSSCj3NkvBtNd6968aeJj3D49QL4KBkpxn5wKMPuEwVn
qj0s7jgpez3hxaPw9TdwO5BRg0mZsPUPxa8w/uNsenZUQ0/HGtns9QwJSi6io/k=
=Vma2
-----END PGP SIGNATURE-----
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev