我是新手,并使用pycharm 5.0.4进行python编码。我发现对于某些库,我的Pycharm无法自动弹出有关潜在方法/类成员资格的帮助提示。像下面一样,该汤应该具有get_text()方法和其他方法,但是IDE不会弹出菜单我可以选择。

我确实看到其他人可以在自己的pycharm中使用它,我会错过任何设置吗?

谢谢,

Please see below graph showing that I didn't get the pop up menu when I need the hint

最佳答案

您可以通过内置的Pycharm "Type Hinting"使其工作。将type: list[Tag]内联注释添加到将select结果分配给变量的行:

python - Pycharm 5.0.4自动完成无法完全正常工作-LMLPHP

请注意,在这种情况下,您需要导入Tag类:

from bs4 import BeautifulSoup, Tag

10-04 22:46
查看更多