You seem to use Python 2.x. Here, print
is a statement and you are printing a tuple to stdout
.
You can achieve what you want with
print >> sys.stderr, "syntax %(name,name,name)"
but this string seems weird to me, especially the %(name,name,name)
part. But as you don't tell us what you really want to print, that's all that can be done.
If you want to use print()
as a function, be it in Python 3.x or after using from __future__ import print_function
, you should obey the syntax of print()
:
print("syntax %(name,name,name)", file=sys.stderr)
Another issue seems to be the string you are printing:
"syntax %(name,name,name)"
resembles me of String formatting where you have omitted the parameters and use wrong syntax.
So, depending on what you want to do,
"syntax %(name)s%(name)s%(name)s" % some_dict_having_name_as_a_key
could be what you want.