问题描述
我刚刚安装了 PyCharm Community Edition 3.4.1 并尝试在其中创建一个简单的 pygame 项目.我发现代码完成以一种奇怪的方式运行.在这种情况下:
I've just installed PyCharm Community Edition 3.4.1 and tried to make a simple pygame project in it. I found that code completion runs in a weird way. In this case:
from pygame import event
event.
当我输入 event.
一个带有 event
方法的完成弹出窗口会立即显示.但在第二种情况下:
when I type event.
a completion popup with event
methods shows immediately. But in the second case:
import pygame
pygame.event.
弹出窗口仅包含 object
方法.
a popup contains only object
methods.
如何学习自动完成工具以深入了解库?
How can I learn the autocomplete tool to look deeper into the library?
推荐答案
除了创建自己的骨骼,你不能.如果启用以下功能,您可以使 pycharm 更好地完成代码:
Other than creating your own skeletons, you can't. You can make pycharm a little better a code completion if you enable the following:
但除此之外,你运气不好.Python 很难进行代码补全,因为它是一种动态语言,并且存根(骨架)并不适用于所有情况.
But other than that, you're out of luck. Python is hard to make code completion for because its a dynamic language, and stubs (skeletons) don't exist for everything.
这篇关于PyCharm 自动完成功能不适用于 pygame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!