FAQ
Hi there,
I installed python 3.1 on Windows Vista PC.
Am an absolute beginner with Python.
This is my problem :

In Idle :

Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
print "Hello"
SyntaxError: invalid syntax (<pyshell#0>, line 1)

At a dos-prompt :

Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
print "Hello"
File "<stdin>", line 1
print "Hello"
^
SyntaxError: invalid syntax
>>>

Looks stupid, probably is, but I cannot figure it out.

Thanks for any help !

Lucky

Search Discussions

  • Krister Svanlund at Dec 30, 2009 at 11:56 am
    In Python 3 the syntax for print has changed to print() so just put
    braces around the string and you'r good to go!
    On Wed, Dec 30, 2009 at 12:48 PM, wrote:
    Hi there,
    I installed python 3.1 on Windows Vista PC.
    Am an absolute beginner with Python.
    This is my problem :

    In Idle :

    Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
    (Intel)] on win32
    Type "copyright", "credits" or "license()" for more information.
    print "Hello"
    SyntaxError: invalid syntax (<pyshell#0>, line 1)

    At a dos-prompt :

    Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
    (Intel)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    print "Hello"
    ?File "<stdin>", line 1
    ? ?print "Hello"
    ? ? ? ? ? ? ? ?^
    SyntaxError: invalid syntax
    Looks stupid, probably is, but I cannot figure it out.

    Thanks for any help !

    Lucky

    --
    http://mail.python.org/mailman/listinfo/python-list
  • Simon Brunning at Dec 30, 2009 at 12:00 pm

    2009/12/30 <lucbonne at hotmail.com>:

    At a dos-prompt :

    Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
    (Intel)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    print "Hello"
    ?File "<stdin>", line 1
    ? ?print "Hello"
    ? ? ? ? ? ? ? ?^
    SyntaxError: invalid syntax
    You are using Python 2 syntax, but a Python 3 interpreter. So, either
    download an earlier version of Python, or use a tutorial which covers
    Python 3.

    Rather unlucky timing, really - Python 3 is the first non-trivially
    backward incompatible version for a very long time - at least a decade
    and a half.

    --
    Cheers,
    Simon B.
  • Ben Finney at Dec 30, 2009 at 12:02 pm

    lucbonne at hotmail.com writes:

    I installed python 3.1 on Windows Vista PC.
    Thank you for this information, it's essential to solving the problem.
    Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
    (Intel)] on win32
    Type "copyright", "credits" or "license()" for more information.
    print "Hello"
    SyntaxError: invalid syntax (<pyshell#0>, line 1)
    You need to follow the correct documentation for the version of Python
    you're using. The above is invalid syntax ? in Python 3. (It was valid,
    in Python 2.)

    Please work through the Python tutorial for the version of Python you're
    using <URL:http://docs.python.org/3.1/tutorial/>, running each exercise
    and experimenting until you understand it before going to the next.

    Good hunting, and keep at it!

    --
    \ ?If you go to a costume party at your boss's house, wouldn't |
    `\ you think a good costume would be to dress up like the boss's |
    _o__) wife? Trust me, it's not.? ?Jack Handey |
    Ben Finney
  • Luc at Dec 30, 2009 at 12:07 pm
    Thanks Krister !
    Should have read specific 3.1 documentation :-( .

    Regards, Luc
    On Dec 30, 12:56?pm, Krister Svanlund wrote:
    In Python 3 the syntax for print has changed to print() so just put
    braces around the string and you'r good to go!

    On Wed, Dec 30, 2009 at 12:48 PM, ?wrote:
    Hi there,
    I installed python 3.1 on Windows Vista PC.
    Am an absolute beginner with Python.
    This is my problem :
    In Idle :
    Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
    (Intel)] on win32
    Type "copyright", "credits" or "license()" for more information.
    print "Hello"
    SyntaxError: invalid syntax (<pyshell#0>, line 1)
    At a dos-prompt :
    Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
    (Intel)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    print "Hello"
    ?File "<stdin>", line 1
    ? ?print "Hello"
    ? ? ? ? ? ? ? ?^
    SyntaxError: invalid syntax
    Looks stupid, probably is, but I cannot figure it out.
    Thanks for any help !
    Lucky
    --
    http://mail.python.org/mailman/listinfo/python-list
  • Luc at Dec 30, 2009 at 12:10 pm
    Also thanks Ben and Simon for your help !
    On Dec 30, 1:07?pm, Luc wrote:
    Thanks Krister !
    Should have read specific 3.1 documentation :-( ?.

    Regards, ?Luc
    On Dec 30, 12:56?pm, Krister Svanlund wrote:

    In Python 3 the syntax for print has changed to print() so just put
    braces around the string and you'r good to go!
    On Wed, Dec 30, 2009 at 12:48 PM, ?wrote:
    Hi there,
    I installed python 3.1 on Windows Vista PC.
    Am an absolute beginner with Python.
    This is my problem :
    In Idle :
    Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
    (Intel)] on win32
    Type "copyright", "credits" or "license()" for more information.
    print "Hello"
    SyntaxError: invalid syntax (<pyshell#0>, line 1)
    At a dos-prompt :
    Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
    (Intel)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    print "Hello"
    ?File "<stdin>", line 1
    ? ?print "Hello"
    ? ? ? ? ? ? ? ?^
    SyntaxError: invalid syntax
    Looks stupid, probably is, but I cannot figure it out.
    Thanks for any help !
    Lucky

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedDec 30, '09 at 11:48a
activeDec 30, '09 at 12:10p
posts6
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase