Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python write to error stream

# Note: this first one does not work in Python 3
print >> sys.stderr, "spam"

sys.stderr.write("spam
")

os.write(2, b"spam
")

from __future__ import print_function
print("spam", file=sys.stderr)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #write #error #stream
ADD COMMENT
Topic
Name
7+5 =