Log or cerr in python?

while solving questions in codechef, general i use C++. And for debugging or to see working/log of my program, I use “cerr” instead of “cout” so my output is not filled with random stuff and there is additional “error box” to help me check my program .
But recently I have been using Python 3.6. I am unable to find anything close to “cerr” of C++.

is there any method in Python to output data other than standard output to create additional dialog box in Codechef IDLE?

I guess you can use stderr provided in sys module to write to error stream.

from sys import stderr

1 Like