Home  >  Q&A  >  body text

如何更加有效地查看(学习)Python第三方库文档(APIs)

描述: 有时候需要了解Python第三方库的API接口,如果盲目地看,乱看,则会导致效率不高(浪费时间)

环境: Windows8+Python2.7

措施:

 1 看源代码-->pass,只需要了解API,不需要了解细节,看源码头脑发胀,无法窥得全貌
 2 看官网文档-->可以,但是由于第三方库文档良莠不齐,而且文档有时候有堆砌的感觉,没有层次感,逻辑感. (有时候需要反复查阅)
3 直接在shell中输入help(),然后查看--> 还可以,但是仅仅看这些有时候不足以全面了解某一个API接口(信息过少)

不知道菊苣们是如何做的?

巴扎黑巴扎黑2717 days ago531

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-17 15:24:37

    1. Search on readthedocs. The style is relatively clear and the documents are generally well organized.
    2. Google search: "API name" + other keywords, you can often find good articles (blogs), Q&A (stackoverflow), and documents organized by others (such as Python Modules Index: http://pymotw.com/2/ genindex.html)

    reply
    0
  • 迷茫

    迷茫2017-04-17 15:24:37

    There is no fixed good method. My own experience is that if dir plus help is not enough to solve the problem, you can look at the source code of the corresponding API. Python code is relatively readable and elegant, but the premise is to write more and read more.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 15:24:37

    Good third-party library documentation will be very good, especially foreign ones. The native English documentation is very well written, and the personal feeling of API should be learned from practice. If you don’t know something, help first. In the source code, help If so, I personally like to watch bpython

    reply
    0
  • Cancelreply