How to print to stderr in Python

2 Answers

0 votes
import sys

print("Error Msg", file = sys.stderr)





'''
run:

Error Msg

'''

 



answered Apr 10, 2021 by avibootz
0 votes
import sys

sys.stderr.write("Error Msg ")





'''
run:

Error Msg

'''

 



answered Apr 10, 2021 by avibootz

Related questions

2 answers 185 views
185 views asked May 4, 2021 by avibootz
1 answer 214 views
...