View Single Post
Old 12-04-2013, 05:19 PM   #3
sup
Zealot
sup began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Sep 2013
Device: Kindle Paperwhite (2012)
Quote:
Originally Posted by kovidgoyal View Post
calibre no longer bundles ipython with it, as it was very large for little gain. If you wish to use ipython you have to add it manually either by modifying sys.path before calling ipython() or manually copying ipython into the calibre install dir.
Ok, although I found the feature quite handy. But at least I now know how to embedd ipython anywhere. Would you please update the documentation here: http://manual.calibre-ebook.com/deve...on-interpreter

And the excersie left to the reader as to how to precisely do that:

1. run ipython and run
import sys
print sys.path
[the path you got]
2. to your recipe, add

Code:
import sys
sys.path.extend([the path you got])
import IPython
from IPython.config.loader import Config
# and then put to a suitable place in tour code this: 
IPython.embed(user_ns=locals())
sup is offline   Reply With Quote