Will work for python 2 and 3 if there are no keyword arguments
def xprint(*args):
print( "XXX"+" ".join(map(str,args))+"XXX")
In [5]: xprint("hi", "yo", 4)
XXXhi yo 4XXX
For a python 3 function print()(or when used print_functionfrom __future__in python 2), keyword arguments may also be present. To ensure their transfer, use the form
def xprint(*args, **kwargs):
print( "XXX"+" ".join(map(str,args))+"XXX", **kwargs)