推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
0001110001011
V2EX  ›  Python

pycharm 如何智能提示出 方法内的 行内注释??

  •  
  •   0001110001011 · Oct 19, 2021 · 2749 views
    This topic created in 1699 days ago, the information mentioned may be changed or developed.

    比如:

    def plot( data, **kwargs ):
        """
        Given a Pandas DataFrame containing columns Open,High,Low,Close and optionally Volume
         
        """
    

    因为注释里面会包含很多参数的信息一类的,比如 kwargs 这种

    现在效果是这样

    怎么设置才能打参数的时候,显示文档呢?

    python 小白, 求大佬指点

    10 replies    2021-10-22 11:16:15 +08:00
    zzm88104
        2
    zzm88104  
       Oct 19, 2021 via iPhone
    用 kite?
    skinny
        3
    skinny  
       Oct 19, 2021
    我也遇到相似的问题,我不知道 Pycharm 为什么能识别 requests 之类库函数的 kwargs 参数里的具体参数的注释(比如参数就一个**kwargs,但是在注释里用:param 指令写具体参数注释),但是在我自己的代码里相同格式的注释却不能识别,甚至我直接复制 requests 库函数的注释出来测试,它都不能识别,还提示注释不规范。
    0001110001011
        4
    0001110001011  
    OP
       Oct 20, 2021
    @zzm88104 kite 也不行。


    @Eiden 大佬这个 图 有什么深得意义吗?
    0001110001011
        5
    0001110001011  
    OP
       Oct 20, 2021
    @Eiden @zzm88104 @skinny

    我测试了 vsocde,和 spyder 都是可以的,但是用不习惯这 两个软件。 很是纠结。
    bnm965321
        6
    bnm965321  
       Oct 20, 2021
    https://stackoverflow.com/questions/3898572/what-is-the-standard-python-docstring-format

    docstring 使用特别的格式编写,然后如果你的编辑器能够支持的话就可以看到了
    shaohan0228
        7
    shaohan0228  
       Oct 20, 2021
    Ctrl + Q 是说快捷键么?
    0001110001011
        8
    0001110001011  
    OP
       Oct 22, 2021
    @bnm965321 谢谢 , 我学习学习.
    0001110001011
        9
    0001110001011  
    OP
       Oct 22, 2021
    @shaohan0228 啥 Ctrl + Q ? 啥意思
    llsquaer
        10
    llsquaer  
       Oct 22, 2021
    pycharm 自动就显示 注释了啊...你是把什么功能关了么 .只要按照 这个格式就没问题.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6016 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 02:21 · PVG 10:21 · LAX 19:21 · JFK 22:21
    ♥ Do have faith in what you're doing.