Logo

Programming-Idioms

History of Idiom 59 > diff from v12 to v13

Edit summary for version 13 by :

Version 12

2015-08-22, 09:58:03

Version 13

2015-08-22, 10:04:26

Idiom #59 Write to standard error stream

Print the message "x is negative" to standard error (stderr), with integer x value substitution (e.g. "-2 is negative").

Idiom #59 Write to standard error stream

Print the message "x is negative" to standard error (stderr), with integer x value substitution (e.g. "-2 is negative").

Imports
import sys
Code
print >>sys.stderr, "%s is negative" % x
Comments bubble
Python2

If possible, use the python3 with "from _future__ import print_function"