What a weird thing !!?

Fredrik Lundh effbot at telia.com
Sat Feb 19 07:06:23 EST 2000


Florent RamiŠre <framiere at netcom-service.com> wrote:
>     sorry for replying this message, but is what you say means that there
is
>     absolutely no way to print excatly what i want to print ???
>
>     I will never be able to display "ab" in two print ???

you're not listening.

"print" is a convenience statement which
inserts a space under certain circumstances
(see the language reference).

if that's not what you want, use a function
instead:

def pr(*args):
    for item in args:
        sys.stdout.write(str(item))

pr("a")
pr("b")

or use formatting operators:

    print "%s%s" % ("a", "b")

or use a string or list to collect the output, and
print it all in one go.

>     That make me nervous about python !

well, as usual, Python works best if you use it to
write Python programs :-)

</F>





More information about the Python-list mailing list