iPython代码完成/点上的Intellisense可能吗? [英] iPython Code Completion / Intellisense on Dot Possible?
问题描述
当有人尝试学习Python的来龙去脉(重点是科学计算-即:pandas,numpy,scikit-learn)时,那里的大多数专家似乎都推荐并使用iPython笔记本.作为初学者/中级编码人员,我最大的坚持是,我需要从IDE中获取代码补全/类似智能感知的功能,以学习功能参数.我还没有硬连线,只是不知道我当前的开发中可以使用哪些参数.
As someone trying to learn the ins and outs of Python (with emphasis on scientific computing - ie: pandas, numpy, scikit-learn), most of the gurus out there seem to recommend and use iPython notebooks. My biggest sticking point as a beginner/intermediate coder is that I NEED code completion / intellisense -like functionality from an IDE to learn the function parameters. I'm not hard-wired yet to just know what parameters are available at my current development.
在iPython中,我注意到我可以按Tab
键显示选项的下拉列表(如以下所示),但我不想每次都单击.对于我的需求而言,这不是用户友好的.相反,我希望它在按dot时仅显示可用的类和方法.
In iPython, I noticed I can press Tab
to show the drop-down of options (seen below as pd.) but I don't want to have to hit each time. That's not user-friendly for my needs. Instead, I would like it to show only available classes and methods when I press dot.
第二,我注意到,如果我确实说了pd.read_csv(<TAB>
,我得到的选项比read_csv
中的实际参数要多得多.
Secondly, I notice that if I did say pd.read_csv(<TAB>
, I get a lot more options than are the actual parameters in read_csv
.
问题:在按点号/句点后,iPython可以立即自动显示准确的代码完成选项吗?另外,有没有一种方法可以将其配置为仅在功能内显示可用的功能参数?
Question: Can iPython automatically show accurate code completion options instantly after pressing dot / period? Also, is there a way to configure it to only show the available function parameters when within a function?
要使这个问题更具体,我并不是在问使用任何其他IDE的问题;我要问的是关于iPython的非常具体的问题,想知道是否有一种方法可以设置某种配置,以便在按下点"(无时间延迟)时立即获得准确的点"显示选项.
To make this question super-specific, I'm not asking about using any other IDE; I'm asking very specifically in regards to just iPython and wondering if there's a way to set some kind of configuration to achieve accurate "dot" display options instantly when pressing "dot" (no time delay).
以下示例显示了Desktop
,它显然不是pd.read_csv()
的参数.
Example below shows Desktop
which is obviously not a parameter of pd.read_csv()
.
推荐答案
您可以按<Shift>-<Tab>
以获得显示功能签名的工具提示:
You can press <Shift>-<Tab>
to get a tooltip showing the function's signature:
或者,调用zip?
会在窗口底部打开一个文档窗格.
Alternatively, invoking zip?
opens a documentation pane at the bottom of the window.
就自动打开工具提示而言,我不确定.我猜想通过配置是不可能的.
As far as having the tooltip open automatically, I'm unsure. I'd guess that it isn't possible via configuration.
这篇关于iPython代码完成/点上的Intellisense可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!