[Idle-dev] Print does not work.

Corey Richardson kb1pkl at aim.com
Mon May 23 04:40:30 CEST 2011


-----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 (tutor at python.org)
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-----


More information about the IDLE-dev mailing list