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

Paul Moore p.f.moore at gmail.com
Mon Oct 9 12:41:29 EDT 2017


On 9 October 2017 at 17:22, John Black <jblack at nopam.com> wrote:
> I want sep="" to be the default without having to specify it every time I
> call print.  Is that possible?

def myprint(*args, **kw):
    print(*args, sep="", **kw)

If you want, assign print=myprint.

Paul



More information about the Python-list mailing list