python - How do I get IPython autoreload magic to load automatcially when using an embedded shell? -


i have following in ipython_config.py:

print "test autoreload" #confirm gets loaded c = get_config() c.interactiveshellapp.extensions = ['autoreload'] c.interactiveshellapp.exec_lines = ['%autoreload 2'] 

and seems work normal ipython sessions:

$ ipython test autoreload in [1]: %autoreload 2 in [2]:  

however, when using embedded shell script uses ipython.embed(), autoreload magic no longer works.

for example, in shell.py:

from ipython import embed embed() 

this still loads ipython_config.py, evidenced "test autoreload" printing out, autoreload extension not loaded (no %autoreload magic):

$ python shell.py test autoreload in [1]: %autoreload 2 error: line magic function `%autoreload` not found. 

as far can tell, (known) bug. extensions loaded if there application, when using embed, won't loaded (although config read).

there open issue on github fix this, has never been implemented.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -