如何在 sublime 中为 python 库自动完成

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28656309/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 03:34:10  来源:igfitidea点击:

How can I have autocomplete for python libraries in sublime

pythonsublimetext3

提问by makkasi

Currently when I import some code, for example:

目前当我导入一些代码时,例如:

from datetime import datetime

I can't see what methods it has. How could I know that there is utcnow() for example. It would be great if there is some plugin for sublime so that I have this functionality , as it is in eclipse with cntr+space for methods. Also may be if there is some navigation between classes definitions , or going to property definition and etc.

我看不出它有什么方法。例如,我怎么知道有 utcnow() 。如果有一些用于 sublime 的插件以便我拥有此功能,那就太好了,因为它在 eclipse 中使用 cntr+space 作为方法。也可能是类定义之间有一些导航,或者转到属性定义等。

Preferences plugins

首选项插件

采纳答案by Vader

You can have this functionality with the Anaconda Package.

您可以通过Anaconda Package获得此功能。

enter image description here

在此处输入图片说明

Anaconda includes a lot more features than just auto completetion. You can install the Jedi Package. This is the the auto complete that ships with Anaconda.

Anaconda 包含的功能远不止自动完成。您可以安装绝地软件包。这是 Anaconda 附带的自动完成。

回答by Mohideen bin Mohammed

try SublimeJEDI

试试SublimeJEDI

step 1: ctrl+shift+psearch - install package

步骤1: ctrl+ shift+psearch - install package

step 2: Wait for few seconds until drop down box to appear

第 2 步:等待几秒钟直到出现下拉框

step 3: search Jedi - Python autocompletionand press enter

第 3 步:搜索Jedi - Python autocompletion并按 Enter

now auto completion for python will work in sublime..

现在 python 的自动完成将在 sublime 中工作..

Note:you can try Anacondainstead Jediusing same step.

注意:您可以尝试Anaconda,而不是Jedi使用同一个步骤。