In the process of learning and practicing Python, I often fail to remember all the methods in some modules, or forget to use them correctly, or report an error when coding
At this time, I will think of tutoring on a relevant knowledge point, in addition to Baidu-related key points Apart from words, one way should be to check the DOC document.
But the local DOC documents are all standard libraries. If you encounter some knowledge and standard postures of third-party libraries, where can you check them?
调用
help
函数,可以看到一个函数或者方法的字符串文档。使用
dir
可以查看模块或对象都有那些方法。使用
ipython+?
查看使用pydoc查看字符串文档
很多第三方库, 都有他们自己的官网, 例如requests库, jinja2库等等. 所以如果你想用的库,刚好有他们的官网, 可以上通过搜索他们的官网上去学习, 但是如果很不幸没有, 那只能通过别人的博客或者分享去学习, 如果等基础到一定程度, 可以去直接看他们模块的源码, 从中找到你需要的东西