Please hear my plea: print without softspace

Valentino Volonghi aka Dialtone dialton3.NOSPAM_ at virgilio.it
Sat Feb 28 09:32:50 EST 2004


In data Sat, 28 Feb 2004 12:01:40 +0000 (UTC), Carmine Noviello ha
scritto:

> def pprint(*args):
>     txt = ""
>     for a in args:
>        txt += str(a)
>     print txt
> 
> Is it ok?

I would use this instead:

def pprint(*args):
    txt = []
    for a in args:
        txt.append(a)
    print ''.join(txt)

which is a lot faster :)

-- 
Valentino Volonghi aka Dialtone
Now using Windows for Notebook Hw failure
X Python Newsreader developer
http://sourceforge.net/projects/xpn/



More information about the Python-list mailing list