Open in CoCalc
import sys print >> sys.stderr, "Hello"
Hello
sys.stderr.write('hi') sys.stderr.flush()
hi
print >> sys.stderr, "Hello"
Hello
from __future__ import print_function print("Hello", file=sys.stderr)
Error in lines 2-2 Traceback (most recent call last): File "/projects/sage/sage-6.9/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 905, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "<string>", line 1 print("Hello", file=sys.stderr) ^ SyntaxError: invalid syntax