制表符在ipython中完成字典的键 [英] tab complete dictionary keys in ipython
问题描述
我想知道是否有人知道如何为IPython中的字典键启用或实现制表符补全?似乎与现有功能(如对象属性的制表符完成)并没有太大不同.如果我错了,那么我想了解原因
I was wondering if anybody knows how to enable or implement tab completion for dictionary keys in IPython? It seems like it wouldn't be very different from functionality that already exists, like tab completion of object attributes. If I'm wrong, then I'd like to understand why
推荐答案
由于 _ipython_key_completions_
.
IPython supports dict key completion for string keys since version 3.0.0 (despite not appearing in release notes), thanks to this patch. It also supports column name completion for numpy struct arrays and pandas DataFrame
columns, and for other types that redefine __getitem__
through defining _ipython_key_completions_
.
这篇关于制表符在ipython中完成字典的键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!