##// END OF EJS Templates
Don't register the same callabck multiple times...
Don't register the same callabck multiple times Using the %matplotlib magics would not always work without this fix: For `%matplotlib qt5` to work, `flush_figures` should not be in `get_ipython().events.callbacks['post_execute']`. Yet without this fix: ```python Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] Type "copyright", "credits" or "license" for more information. IPython 7.18.1 -- An enhanced Interactive Python. In [1]: %matplotlib inline In [2]: %matplotlib inline In [3]: %matplotlib inline In [4]: %matplotlib inline In [5]: get_ipython().events.callbacks['post_execute'] Out[5]: [<bound method AutoreloadMagics.post_execute_hook of <autoreload.AutoreloadMagics object at 0x00000199BFE73888>>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function matplotlib.pyplot.install_repl_displayhook.<locals>.post_execute()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>] In [6]: %matplotlib qt5 In [7]: get_ipython().events.callbacks['post_execute'] Out[7]: [<bound method AutoreloadMagics.post_execute_hook of <autoreload.AutoreloadMagics object at 0x00000199BFE73888>>, <function matplotlib.pyplot.install_repl_displayhook.<locals>.post_execute()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>] In [8]: ```
Quentin Peter -
r26114:73ca78ca
Show More
Name Size Modified Last Commit Author
/ IPython
core
extensions
external
kernel
lib
sphinxext
terminal
testing
utils
__init__.py Loading ...
__main__.py Loading ...
config.py Loading ...
conftest.py Loading ...
consoleapp.py Loading ...
display.py Loading ...
frontend.py Loading ...
html.py Loading ...
nbconvert.py Loading ...
nbformat.py Loading ...
parallel.py Loading ...
paths.py Loading ...
qt.py Loading ...