Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #101407

Re: Problem with 'print'

From "D'Arcy J.M. Cain" <darcy@VybeNetworks.com>
Newsgroups comp.lang.python
Subject Re: Problem with 'print'
Date 2016-01-09 10:19 -0500
Organization Vybe Networks Inc.
Message-ID <mailman.95.1452353286.2305.python-list@python.org> (permalink)
References <CAOtrjidkbrDPzqkEeMjbmWcgscr0k_vK_Ns=SfjXPHzVGyovNQ@mail.gmail.com>

Show all headers | View raw


On Sat, 9 Jan 2016 12:40:16 +0100
pablo gormi <pablogormi822@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@Vex.Net VoIP: sip:darcy@VybeNetworks.com

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Problem with 'print' "D'Arcy J.M. Cain" <darcy@VybeNetworks.com> - 2016-01-09 10:19 -0500

csiph-web