发布于 2017-06-02 00:30:47 | 133 次阅读 | 评论: 0 | 来源: 网友投递
IPython Python的命令行交互
IPython 是 Python 的原生交互式 shell 的增强版,可以完成许多不同寻常的任务,比如帮助实现并行化计算;主要使用它提供的交互性帮助,比如代码着色、改进了的命令行回调、制表符完成、宏功能以及改进了的交互式帮助。
IPython 5.4.0 和 6.1.0 发布了,有如下更新:
5.4.0
IPython 5.4-LTS 支持在 IPython 6.0 和 6.1 中创建的大部分新的暴露的 API 添加,并避免根据 IPython 的版本编写条件逻辑。更多更新内容点此查看。
Quotes in a filename are always escaped during tab-completion on non-Windows. PR #10069
Variables now shadow magics in autocompletion. See #4877 and PR #10542.
Added the ability to add parameters to alias_magic. For example:
In [2]: %alias_magic hist history --params "-l 2" --line Created `%hist` as an alias for `%history -l 2`. In [3]: hist %alias_magic hist history --params "-l 30" --line %alias_magic hist history --params "-l 2" --line
Previously it was only possible to have an alias attached to a single function, and you would have to pass in the given parameters every time:
In [4]: %alias_magic hist history --line Created `%hist` as an alias for `%history`. In [5]: hist -l 2 hist %alias_magic hist history --line
To suppress log state messages, you can now either use %logstart -q
, pass--LoggingMagics.quiet=True
on the command line, or set c.LoggingMagics.quiet=True
in your configuration file.
An additional flag --TerminalInteractiveShell.term_title_format
is introduced to allow the user to control the format of the terminal title. It is specified as a python format string, and currently the only variable it will format is {cwd}
.
??
/%pinfo2
will now show object docstrings if the source can’t be retrieved. PR #10532
IPython.display
has gained a %markdown
cell magic. PR #10563
%config
options can now be tab completed. PR #10555
%config
with no arguments are now unique and sorted. PR #10548
Completion on keyword arguments does not duplicate =
sign if already present. PR #10547
%run -m <module>
now <module>
passes extra arguments to <module>
. PR #10546
completer now understand “snake case auto complete”: if foo_bar_kittens
is a valid completion, I can type f_b<tab>
will complete to it. PR #10537
tracebacks are better standardized and will compress /path/to/home
to ~
. PR #10515