Biting the bullet?

Kevin Cummings cummings at kjchome.homeip.net
Fri May 22 20:56:41 UTC 2015


Never mind, I read your comment backwards.  Indeed, this looks like a
python2 vs python3 problem.

On 05/22/2015 04:53 PM, Kevin Cummings wrote:
> On 05/22/2015 06:19 AM, Patrick O'Callaghan wrote:
>> On Fri, 2015-05-22 at 00:13 -0400, Kevin Cummings wrote:
>>> print is a function in python.  Its arguments must appear inside ()'s,
>>> just like the error messages tell you.
>>>
>>> ie  not:
>>>
>>>         print input['name']
>>>
>>> but instead:
>>>
>>>         print(input['name'])
>>
>> AFAIK the former would be valid in Python 2, but things changed with
>> Python 3.
> 
> Then why does my python3 interpreter show the following:
> 
> python3
> Python 3.3.2 (default, Dec  4 2014, 12:49:00)
> [GCC 4.8.3 20140911 (Red Hat 4.8.3-7)] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> print 5
>   File "<stdin>", line 1
>     print 5
>           ^
> SyntaxError: invalid syntax
>>>> print(5)
> 5
>>>>
> 
>> poc
>>
> 

-- 
Kevin J. Cummings
kjchome at verizon.net
cummings at kjchome.homeip.net
cummings at kjc386.framingham.ma.us
Registered Linux User #1232 (http://www.linuxcounter.net/)


More information about the users mailing list