Python: Print to stderr
Python Basic: Exercise-52 with Solution
Write a Python program to print to stderr.
Sample Solution:-
from __future__ import print_function
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
eprint("abc", "efg", "xyz", sep="--")
========== RESTART: F:/Python_APSC/py-ex-basic-52.py ============
abc--efg--xyz
>>>
沒有留言:
張貼留言