December 2000
Intermediate to advanced
816 pages
16h 57m
English
One of the last and more argumentative additions to Python 2.0 is the extended print statement. The change, which employs a pair of “greater than” symbols (>>), allows you to direct the output of print to a file other than standard output.
In the example below, we utilize our import of sys.stderr to err above:
>>> print >> err, "using sys.stderr again"
using sys.stderr again
Read now
Unlock full access