ipython demo

Markdown cell C-m m

List

  • Hello
    • World!

Block quote

Link

Code block

def hello(): return [for i in range(0, 200)]

Latex

$$H' = -\sum_{i=1}^R p_i \ln p_i$$

tab completion and tab help (docstring). Shift + Enter to run


In [2]:
[i for i in range(10)]


Out[2]:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Magic functions %lsmagic


In [2]:
%lsmagic


Available line magics:
%alias  %alias_magic  %autocall  %automagic  %bookmark  %cd  %clear  %colors  %config  %connect_info  %debug  %dhist  %dirs  %doctest_mode  %ed  %edit  %env  %gui  %hist  %history  %install_default_config  %install_ext  %install_profiles  %killbgscripts  %less  %load  %load_ext  %loadpy  %logoff  %logon  %logstart  %logstate  %logstop  %lsmagic  %macro  %magic  %man  %more  %notebook  %page  %pastebin  %pdb  %pdef  %pdoc  %pfile  %pinfo  %pinfo2  %popd  %pprint  %precision  %profile  %prun  %psearch  %psource  %pushd  %pwd  %pycat  %pylab  %qtconsole  %quickref  %recall  %rehashx  %reload_ext  %rep  %rerun  %reset  %reset_selective  %run  %save  %sc  %store  %sx  %system  %tb  %time  %timeit  %unalias  %unload_ext  %who  %who_ls  %whos  %xdel  %xmode

Available cell magics:
%%!  %%bash  %%capture  %%file  %%perl  %%prun  %%python3  %%script  %%sh  %%sx  %%system  %%timeit

Automagic is ON, % prefix IS NOT needed for line magics.

In [3]:
%timeit?

Line magic: single %


In [4]:
%timeit [x for x in range(0,5000)]


1000 loops, best of 3: 609 us per loop

Cell magic: double %

Welcome to the HK P UG.


In [5]:
%%perl
''=~('(?{'.('-)@.)@_*([]@!@/)(@)@-@),@(@@+@)'
^'][)@]`}`]()`@.@]@%[`}%[@`@!#@%[').',"})')


Just another Perl hacker,

System shell command with bang!


In [6]:
! cal


    August 2013       
Su Mo Tu We Th Fr Sa  
             1  2  3  
 4  5  6  7  8  9 10  
11 12 13 14 15 16 17  
18 19 20 21 22 23 24  
25 26 27 28 29 30 31  
                      

Us