Ipython

Features

  • Tab completion <Tab>
    • tab after command
    • object.<tab>
  • introspection (?) operator after a variable (object)
    • ?? show more if possible
  • Terminal Shortcuts
    • follow Emacs keys and Linux shell keys
    • Ctrl + Shift + V paste from clipboard
  • Command Line history
    • Ctrl + P (Up), Ctrl + N (Down) : previous or next history (by %run)
    • _ _and \_ stored previous two commands,
      • _<n> stores previous nth output
      • _i<n> previous nth input
        • eval(_i27)

Magic Commands

  • %run, %load
  • %prun - Execute with c profile statement
    • %paste, %cpaste
    • %%prun - profile code block
  • %lprun - line profiler
    • uses line_profiler
    • %lprun -f func1 -f func2 <statement to profile>
  • %quickref, %magic - documentation
  • %who, who_ls whos
    • display variable
  • %xdel <variable>
    • %reset - delete all variables
  • % pdb - use pdb to debug
    • %debug : drops you to the stack frame after error is thrown
      • u and d to shift levels
  • %page Object
    • pretty print object
  • %time, %timeit <statement>
    • time time once, timeit takes multiple runs and average
  • command line ones
    • !<cmd>
      • cmd in system shell
      • can combine with current python variables with $
        • foo = 'test*' # wildcard
          !ls $foo
          
    • %alias <alias_name> <cmd>
      • give command alias
    • %pwd
    • %bookmark <name> <dir>
      • -b: override and use bookmark location
      • -l: list all bookmarks
    • %cd
      • %pushd, %popd
    • %dirs
    • %ddhist
      • history of visited directories
    • %env
      • environmental variables
  • Matplotlib
    • %matplotlib: configure matplotlib options
      • %matplotlib inline

Advanced Features

  • Ipython-Friendly Class
    • __repr\_ _methods
  • Profiles and Configuration
    • .ipython/profile_default/ipython_config.py
    • .jupyter/
    • ipython --profile=<profile>

Jupyter Notebook

results matching ""

    No results matching ""