* an enhanced interactive Python interpreter, offering tab completion, object introspection...
* an enhanced command shell for Python
* high performance tools for parallel computing ?
* supporting interactive computing in any language ?
//=== my environment, Win7x64
0. download and install Anaconda (Python+ iPython + notebook + ... )
1. open Anaconda cmd prompt
//=== install ipython by Anaconda
> conda update conda
> conda update ipython
> pip install ipython
or include the dependencies for the IPython notebook:
> pip install "ipython[notebook]"
manually download IPython from Github or PyPI. To install one of these versions, unpack it and run the following from the top-level source directory using the Terminal:
> python setup.py install
* ipython is a module for python from this perspective
//=== how to start ipython
anaconda cmd prompt
line-oriented and cell-oriented magics.
Line magics are prefixed with the % character and work much like OS command-line calls:
they get as an argument the rest of the line, where arguments are passed without parentheses or quotes.
Cell magics are prefixed with a double %%, and they are functions that get as an argument
not only the rest of the line, but also the lines below it in a separate argument.
%pastebin 3 18-20 ~1/1-5
This will take line 3 and lines 18 to 20 from the current session, and lines 1-5 from the previous session.
In : !ping www.bbc.co.uk
In : !ls
'ls' is not recognized as an internal or external command,
In : !dir
In : x=4
In : !echo $x
In : quit
> ipython profile create
to produce the default config files.
These will be placed in ~/.ipython/profile_default
> ipython profile create foo # create the profile foo
> ipython locate profile foo
> ipython --profile=foo # start IPython using the new profile
rem prompt $P$G
//=== ipython tutorial
[Q] what's ipython ?
[Q] what's ipython notebook ?
[Q] what's ipython Qt console?
//=== ipython notebook :
0. a web app
1. turn console-based ipython to web-based
2. code + contents
* to start an ipython notebook server from the command line
> ipython notebook --profile=urprofile
*** nbconvert and nbviewer
Notebooks may be exported to a range of static formats, including HTML, Markdown, LaTeX, PDF ... , via 'nbconvert'
In effect, nbviewer is simply nbconvert as a web service ?
> ipython nbconvert notebook.ipynb
> ipython nbconvert --to html notebook.ipynb
> ipython nbconvert --to markdown notebook.ipynb --stdout
//=== how to run code in the IPython Notebook
* Shift-Enter: run cell
Execute the current cell, show output (if any), and jump to the next cell below.
* Ctrl-Enter: run cell in-place
Execute the current cell as if it were in “terminal mode”, where any output is shown, but the cursor remains in the current cell.
* Alt-Enter: run cell, insert below
Executes the current cell, shows the output, and inserts a new cell between the current cell and the cell below
* Esc and Enter: Command mode and edit mode
[Q] where does ipython notebook store the new document?
--> under the folder where you start notebook.