A short python program to demonstrate a bug I keep running into:
import pylab
pylab.ion()
pylab.title('doom')
pylab.pause(0)
If I run it, it works fine, but I get this warning:
/usr/lib/pymodules/python2.7/matplotlib/backend_bases.py:2280: MatplotlibDeprecationWarning: Using default event loop until function specific to this GUI is implemented
If I remove the pause line, then I don't get the warning, but my plot ceases to exist as soon as the program finishes.
I should like an elegant way to get the behaviour without the warning. Can anyone help?
Use the warnings
module.
https://pymotw.com/2/warnings/
import warnings
..
..
warnings.filterwarnings("ignore",".*GUI is implemented.*")
This looks for the pattern 'Gui is implemented' in any warning being issued and ignores it but allows other warnings to be reported.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With