If you are a command-line lover, then it is likely that ipython
is already
one of your friend. In Python, help()
is our swiss army knife. However, always
having to embrace commands with parathesis, (
and )
, is really a hassle!
Wouldn't it be great if we could simply invoke like this?
%help unknown_command
- Create a file
ipython_startup.py
with the following content:
from IPython.core.magic import register_line_magic
@register_line_magic
def help(line):
if line == '':
help()
else:
help(eval(line))
del help
- Set
c.InteractiveShellApp.exec_files = ['/path/to/your/file']
within youripython_config.py
.- If you don't know what that is, please see https://ipython.readthedocs.io/en/stable/config/intro.html.