How to Run a Python Program with Warnings Without Ignoring Them? or Best Way to Handle Warnings When

20 Replies, 1157 Views

If you're trying to python run program with warnings without ignoring them, try using `logging.captureWarnings(True)` along with Python's `logging` module.

This way, warnings get treated like logs and you can redirect them to a file or console however you want.

Also, `-W error` can turn warnings into exceptions if you *really* wanna force yourself to fix 'em.

Messages In This Thread



Users browsing this thread: 1 Guest(s)