2020-11-22 12:10:48 +00:00
|
|
|
# Create a ipython profile
|
2017-06-10 20:20:00 +00:00
|
|
|
ipython profile create profile_name
|
|
|
|
|
2020-11-22 12:10:48 +00:00
|
|
|
# Use specified profile
|
2017-06-10 20:20:00 +00:00
|
|
|
ipython --profile=${profile_name}
|
|
|
|
|
2020-11-22 12:10:48 +00:00
|
|
|
# List objects, functions, etc. that have been added in the current namespace,
|
2017-06-10 20:20:00 +00:00
|
|
|
# as well as modules that have been imported
|
|
|
|
%who
|
|
|
|
|
|
|
|
# Assign a name to a set of input commands,
|
|
|
|
# so that they can be executed all together using the assigned name
|
|
|
|
%macro
|
|
|
|
|
2020-11-22 12:10:48 +00:00
|
|
|
# This will open an editor (whatever the shell variable EDITOR is set to,
|
|
|
|
# see above, or vi/vim if no variable is set)
|
2017-06-10 20:20:00 +00:00
|
|
|
# containing the specified material, based on what arguments are provided,
|
|
|
|
# and will execute that code once the editor is exited
|
|
|
|
%edit
|
|
|
|
|
|
|
|
# This lists all ipython magic commands
|
|
|
|
%lsmagic
|
|
|
|
|
2020-11-22 12:10:48 +00:00
|
|
|
# Store variables, functions, etc. that you've defined in .ipython/ipythonrc
|
|
|
|
# for use in future sessions
|
2017-06-10 20:20:00 +00:00
|
|
|
%store
|
|
|
|
|
2020-11-22 12:10:48 +00:00
|
|
|
# Configure ipython to automatically open the python debugger pdb
|
|
|
|
# when an error occurs
|
2017-06-10 20:20:00 +00:00
|
|
|
%pdb
|
|
|
|
|
2020-11-22 12:10:48 +00:00
|
|
|
# Timing functions to see how long expressions take to execute
|
2017-06-10 20:20:00 +00:00
|
|
|
%time
|
|
|
|
%timeit
|
|
|
|
|
2020-11-22 12:10:48 +00:00
|
|
|
# Log ipython input and/or output to files
|
2017-06-10 20:20:00 +00:00
|
|
|
%logstart
|
|
|
|
%logon
|
|
|
|
%logoff
|
|
|
|
%logstate
|
|
|
|
|
2020-11-22 12:10:48 +00:00
|
|
|
# Change directories, manipulate directory stacks, create directory "bookmarks"
|
2017-06-10 20:20:00 +00:00
|
|
|
%cd
|
|
|
|
%pushd
|
|
|
|
%popd
|
|
|
|
%bookmark
|
|
|
|
|
|
|
|
# Resets the interactive environment
|
|
|
|
%reset
|
|
|
|
|
|
|
|
# Allows you to see any part of your input history
|
2020-10-15 17:29:27 +00:00
|
|
|
%hist
|
2017-06-10 20:20:00 +00:00
|
|
|
|
|
|
|
# Search ("grep") through your history by typing
|
|
|
|
%hist -g somestring
|
|
|
|
|
|
|
|
# List objects, functions, etc. that have been added in the current
|
|
|
|
# namespace, as well as modules that have been imported
|
|
|
|
%who
|
|
|
|
|
|
|
|
# Show internal IPython aliases
|
|
|
|
%alias
|
|
|
|
|
|
|
|
# Embed ipython in python code
|
|
|
|
from IPython import embed; embed()
|