Is there a way to globally set the print function separator?

Terry Reedy tjreedy at udel.edu
Mon Oct 9 12:46:53 EDT 2017


On 10/9/2017 12:22 PM, John Black wrote:
> I want sep="" to be the default without having to specify it every time I
> call print.  Is that possible?
> 
> John Black

Define a replacement print function that makes this the default. 
Something like (untested, a detail may be wrong):

_print = print
def print(*args, **kwargs):
     _print(*args, {'sep':''}.update(kwargs))


-- 
Terry Jan Reedy




More information about the Python-list mailing list