How to disable Python warnings? - Stack Overflow

PHOTO EMBED

Fri Jan 07 2022 01:54:40 GMT+0000 (Coordinated Universal Time)

Saved by [deleted user]

import warnings

def fxn():
    warnings.warn("deprecated", DeprecationWarning)

with warnings.catch_warnings():
    warnings.simplefilter("ignore")
    fxn()
content_copyCOPY

https://stackoverflow.com/questions/14463277/how-to-disable-python-warnings