[Tutor] "Print" on 3.1 for Mac?

wesley chun wescpy at gmail.com
Mon Jun 29 20:08:12 CEST 2009


On Mon, Jun 29, 2009 at 3:59 AM, Christian Witts<cwitts at compuscan.co.za> wrote:
> lev at ithstech.com wrote:
>>
>> Have I installed something incorrectly in Python 3.1 for Mac if I get a
>> syntax error on
>>
>> print "hello world"
>>
>> My Python 2.3.5 executes this just fine.  What have I missed?
>
> Please take a read through http://docs.python.org/3.0/whatsnew/3.0.html for
> a list of changes from the 2.x series to 3.x.  It includes the fact that the
> print command is now a function and needs to be called accordingly, ie.
> print("Hello world!")


in addition to reading the "What's New" document, you should also be
aware that there is a "2to3" tool that comes with Python that helps
port your existing Python 2 scripts to be as 3.x-compliant as they
can.

hope this helps!
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
"Python Fundamentals", Prentice Hall, (c)2009
    http://corepython.com

wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com


More information about the Tutor mailing list