Python and Intellisense

前端 未结 16 936
南方客
南方客 2020-12-02 09:33

Is there an equivalent to \'intellisense\' for Python?

Perhaps i shouldn\'t admit it but I find having intellisense really speeds up the \'discovery phase\' of learn

16条回答
  •  星月不相逢
    2020-12-02 10:12

    The dynamic nature of the language tends to make autocomplete type analysis difficult, so the quality of the various completion facilities menitoned above varies wildly.

    While it's not exactly what you asked for, the ipython shell is very good for exploratory work. When I'm working with a new module, I tend to pull it into ipython and poke at it. Having tried most of the solutions mentioned above (though it's been years since Wing), ipython's completion facilities are consistently more reliable. The two main tools for exploration are tab complete and appending a question mark to the module/function name to get the help text, e.g.:

    In [1]: import sqlalchemy
    
    In [2]: sqlalchemy.s #tab completion
    sqlalchemy.schema    sqlalchemy.select    sqlalchemy.sql       sqlalchemy.subquery
    
    In [2]: sqlalchemy.select? #Shows docstring
    
    In [3]: sqlalchemy.select?? #Shows method source
    
    In [4]: edit sqlalchemy.select #opens the source in an editor
    

提交回复
热议问题