制表符在ipython中完成字典的键 [英] tab complete dictionary keys in ipython

查看:71
本文介绍了制表符在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 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆