2

I want to print my own digest of the warnings that occurred in my module, as a larger application was meant to display these errors back to the user.

I've been using pythonswarnings.warn when I want to report something to the user, for example a key repeated twice with different values from a flat file that a python dict can't represent.

My trouble is I want to use my module as a module, two way information bount between it and it's caller. Python warnings seem only to go to stdout, so seemingly the only way to capture them is to be silent to stdout my module, and run that module in a subprocess.

I do not want to capture warnings as exceptions as that would break execution on the warning, and I need the loops to continue.

ThorSummoner
  • 16,657
  • 15
  • 135
  • 147

0 Answers0