print , (was Re: Python vs. Perl, which is better to learn?)

François Pinard pinard at iro.umontreal.ca
Fri May 3 12:09:38 EDT 2002


[Alex Martelli]

> I find Python's print convenient for debugging purposes, and that's
> about all.

Same here.  For real output when I control everything, the simplest is to do:

        write = sys.stdout.write

and then:

        write(DATUM)

`write' will write DATUM exactly, with nothing added.

I see `print' as useful when used interactively, or else, as debugging
statements in batch scripts.  I gave myself the rule, which I follow very
strictly, of never using `print' into a production script.  I use editing
commands to blindly comment all remaining `print' when something goes
into production.  This is convenient and useful for me.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list