##// END OF EJS Templates
Describe differences between start_ipython and embed...
MinRK -
Show More
@@ -784,17 +784,27 b' command-line options, as those are trapped first by Python itself.'
784 Embedding IPython
784 Embedding IPython
785 =================
785 =================
786
786
787 It is possible to start an IPython instance inside your own Python
787 You can start a regular IPython session with
788 programs. This allows you to evaluate dynamically the state of your
788
789 code, operate with your variables, analyze them, etc. Note however that
789 .. sourcecode:: python
790
791 import IPython
792 IPython.start_ipython()
793
794 at any point in your program. This will load IPython configuration,
795 startup files, and everything, just as if it were a normal IPython session.
796 In addition to this,
797 it is possible to embed an IPython instance inside your own Python programs.
798 This allows you to evaluate dynamically the state of your code,
799 operate with your variables, analyze them, etc. Note however that
790 any changes you make to values while in the shell do not propagate back
800 any changes you make to values while in the shell do not propagate back
791 to the running code, so it is safe to modify your values because you
801 to the running code, so it is safe to modify your values because you
792 won't break your code in bizarre ways by doing so.
802 won't break your code in bizarre ways by doing so.
793
803
794 .. note::
804 .. note::
795
805
796 At present, trying to embed IPython from inside IPython causes problems. Run
806 At present, embedding IPython cannot be done from inside IPython.
797 the code samples below outside IPython.
807 Run the code samples below outside IPython.
798
808
799 This feature allows you to easily have a fully functional python
809 This feature allows you to easily have a fully functional python
800 environment for doing object introspection anywhere in your code with a
810 environment for doing object introspection anywhere in your code with a
@@ -59,6 +59,9 b' there is an official public API for starting IPython:'
59
59
60 This is what packages should use that start their own IPython session,
60 This is what packages should use that start their own IPython session,
61 but don't actually want embedded IPython (most cases).
61 but don't actually want embedded IPython (most cases).
62 :func:`IPython.embed()` is used for embedding IPython into the calling namespace,
63 similar to calling :func:`Pdb.set_trace`, whereas :func:`start_ipython`
64 will start a plain IPython session, loading config and startup files as normal.
62
65
63 We also have added:
66 We also have added:
64
67
General Comments 0
You need to be logged in to leave comments. Login now