I'm trying to config IPython show warning message once with module warnings, the simple code as below
import warnings
warnings.simplefilter('once', RuntimeWarning)
def x()
warnings.warn('xxx', RuntimeWarning)
x()
C:\Program Files (x86)\Python37-32\Scripts\ipython:2: RuntimeWarning: xx
x()
C:\Program Files (x86)\Python37-32\Scripts\ipython:2: RuntimeWarning: xx
as you can see the warning always show, if I use warning.simplefilter('ignore', RuntimeWarning) then the warning message will be hide. and also tried in python terminal, it work as expected.
so is IPython doesn't support show warning message once? or is there anything wrong?
Thanks in advance.