View Single Post
Old 03-16-2020, 08:34 AM   #5
The_book
Zealot
The_book began at the beginning.
 
Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Works for me with

calibre-debug -c "from calibre import ipython; ipython()"


have you edited the source code of calibre/__init__.py??
Yes, and I find why.
I add print ("Hello, world!") near the top of __init__.py. It works.
Then I continue to read and simply add code after print ("Hello, world!") , which cause error.
Then I find that calibre-debug -c "from calibre import ipython; ipython()" works with the unchange __init__.py.

Then I add
from calibre import ipython
ipython(locals())
to the end of __init__.py

It works.

After some checking, I find I should use those codes after defining of ipython function.
The_book is offline   Reply With Quote