My Cheat on ipython 7.5
1 Installation
I installed ipython by running pip install ipython without issues. I needed to start a new terminal for ipython to be seen in my path.
1.1 when using pyenv (pre 3.6)
Users/zintis/eg[7] % which ipython /Users/zintis.pyenv/shims/ipython /Users/zintis/eg[8] %
1.2 when useing venv (post 3.6)
$ which ipython /Users/zintis/bin/python/venv-39/bin/ipython (venv-39) /Users/zintis/bin/python/bin[509]: $
2 Documentation
ipython is documented in readthedocs.io ipython tutorial is also there.
3 Tips
(most obvious ones only)
- history (and up and down arrows)
history -n
%recall n
%repeat 5
%rep
(rep for "repeat")tab
(for command completion) for example say you have a string var s, then s.<tab> will give you all the options you can run on strings likes.upper()
s.capitalize()
s.join()
etc…
- tab for commands
for example
import time, time.<tab>
bang
for shell commands i.e.!pwd
or!ls
- list all defined variables so far:
dir()
- list all global variables so far:
globals()
- list all local variables so far:
locals()