Problem with 'print'

D'Arcy J.M. Cain darcy at VybeNetworks.com
Sat Jan 9 10:19:29 EST 2016


On Sat, 9 Jan 2016 12:40:16 +0100
pablo gormi <pablogormi822 at gmail.com> wrote:
> Hello, recently I downloaded python, but when I try to execute one
> file with the command 'print' it shows me a error. The error is:
> 
> Missing parentheses in call to 'print'

You downloaded Python 3.<something> but your script was written for
Python 2.<something>.  You have a few choices.

Remove Python and install Python 2.7.
Edit your script to bring it up to the latest version.
Run 2to3 on your script or even whole directories.

The first may be the easiest but you will have to do one of the others
eventually so I would discourage it.

There are plenty of sites (GIYF) that explain the differences between 2
and 3.  You can manually edit all of your files.

Current Python comes with a program called 2to3 that does 99% of the
work for you.  You should probably review the changes it makes (capture
the output) to see if anything needs to be tweaked.  This is definitely
the best solution IMO.

-- 
D'Arcy J.M. Cain
Vybe Networks Inc.
http://www.VybeNetworks.com/
IM:darcy at Vex.Net VoIP: sip:darcy at VybeNetworks.com



More information about the Python-list mailing list