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


Groups > comp.lang.python > #111984 > unrolled thread

Python Print Error

Started byCai Gengyang <gengyangcai@gmail.com>
First post2016-07-28 10:40 -0700
Last post2016-07-29 00:49 +0200
Articles 5 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  Python Print Error Cai Gengyang <gengyangcai@gmail.com> - 2016-07-28 10:40 -0700
    Re: Python Print Error Joel Goldstick <joel.goldstick@gmail.com> - 2016-07-28 14:00 -0400
    Re: Python Print Error Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-28 12:03 -0600
    Re: Python Print Error Timothy <timothy@nospam.tld> - 2016-07-28 22:30 +0000
    Re: Python Print Error Stephane Wirtel <stephane@wirtel.be> - 2016-07-29 00:49 +0200

#111984 — Python Print Error

FromCai Gengyang <gengyangcai@gmail.com>
Date2016-07-28 10:40 -0700
SubjectPython Print Error
Message-ID<386ac508-c9ef-4b7e-907c-00005d04af0f@googlegroups.com>
How to debug this ?

>>> print "This line will be printed."
SyntaxError: Missing parentheses in call to 'print'

[toc] | [next] | [standalone]


#111985

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2016-07-28 14:00 -0400
Message-ID<mailman.1.1469728837.6033.python-list@python.org>
In reply to#111984
On Thu, Jul 28, 2016 at 1:40 PM, Cai Gengyang <gengyangcai@gmail.com> wrote:
> How to debug this ?
>
>>>> print "This line will be printed."
> SyntaxError: Missing parentheses in call to 'print'
> --
> https://mail.python.org/mailman/listinfo/python-list

You are using python 3.x.  print is a function.  Use print("this line
will be printed")

-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays

[toc] | [prev] | [next] | [standalone]


#111986

FromIan Kelly <ian.g.kelly@gmail.com>
Date2016-07-28 12:03 -0600
Message-ID<mailman.2.1469729037.6033.python-list@python.org>
In reply to#111984
On Thu, Jul 28, 2016 at 11:40 AM, Cai Gengyang <gengyangcai@gmail.com> wrote:
> How to debug this ?
>
>>>> print "This line will be printed."

This is Python 2 print statement syntax.

> SyntaxError: Missing parentheses in call to 'print'

This indicates that you're trying to run the above in Python 3.

[toc] | [prev] | [next] | [standalone]


#111998

FromTimothy <timothy@nospam.tld>
Date2016-07-28 22:30 +0000
Message-ID<579a878d$0$14172$2d255a9b@news.tweak.nl>
In reply to#111984
On Thu, 28 Jul 2016 10:40:28 -0700, Cai Gengyang wrote:
> How to debug this ?
> 
>>>> print "This line will be printed."
> SyntaxError: Missing parentheses in call to 'print'

You are probably using Python 3, while the syntax is for Python 2.
Use print("This line will be printed.") instead.

[toc] | [prev] | [next] | [standalone]


#112000

FromStephane Wirtel <stephane@wirtel.be>
Date2016-07-29 00:49 +0200
Message-ID<mailman.14.1469746161.6033.python-list@python.org>
In reply to#111984
In fact, the issue is well defined, "Missing parentheses in call to 
'print'", in this case, you have to add the parentheses when you call 
'print'.

print("In Python3, you must to add the parentheses")




On 07/28, Cai Gengyang wrote:
>How to debug this ?
>
>>>> print "This line will be printed."
>SyntaxError: Missing parentheses in call to 'print'
>-- 
>https://mail.python.org/mailman/listinfo/python-list

-- 
Stéphane Wirtel - http://wirtel.be - @matrixise

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web