Open guaka opened 10 years ago
I have no idea, since I am not an IPython user myself. I welcome your own feedback.
I started hacking towards this, by copying main()
into another file and adapting it so that it returns global_vars
. If I manage to get these global_vars in the IPython environment it would be quite workable.
Another approach is to let erppeek check for the presence of IPython and in that case use that as an alternative to erppeek._interact()
.
I think what you want is something like this:
try:
import IPython
return IPython.start_ipython(user_ns=global_vars)
except ImportError:
pass # Continue to set up a basic shell if IPython isn't installed
Excellent! It worked after I added a line for handling argv
.
try:
import IPython
sys.argv = [sys.argv[0]]
return IPython.start_ipython(user_ns=global_vars)
except ImportError:
pass # Continue to set up a basic shell if IPython isn't installed
You can also pass argv=sys.argv[:1]
into start_ipython()
- that will prevent IPython from trying to parse your programs arguments, but if the user inspects sys.argv
, they'll still see the original value.
Nice, but unfortunately erppeek
exits without any feedback when I try IPython.start_ipython(user_ns=global_vars, argv=sys.argv[:1])
Oh, sorry, it should be just argv=[]
(i.e. an empty list).
@florentx you could replace the [question] label with the [enhancement] label :)
Please confirm that 1.6 gives enough flexibility for IPython.
I have posted details on pull request #62 ... You can contribute an addition to the documentation, if it works.
I'm very happy I just bumped into this project. I'm also a very happy IPython user.
Is there a way to get erppeek inside ipython? (or vice versa)