magic function in IPython - Serbipunk/notes GitHub Wiki
IPython has a set of predefined ‘magic functions’ that you can call with a command line style syntax. There are two kinds of magics,
- line-oriented
- cell-oriented.
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. Lines magics can return results and can be used in the right hand side of an assignment.
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.
timeit
https://stackoverflow.com/questions/29280470/what-is-timeit-in-python