简体   繁体   English

如何在python help()内置函数结果中搜索某些单词?

[英]How to search some word in python help() built-in function result?

Sometimes I need search some thing inside some python library docs that I have installed and I always use help() built-in function but I would like to know if there are some way to search inside this content or even better, without need to open a python terminal. 有时我需要在已安装的某些python库文档中搜索某些东西,并且始终使用内置的help()函数,但是我想知道是否有某种方法可以在此内容中搜索甚至更好,而无需打开python终端。 I really would like to know some clean way to do this (linux based), avoiding pipes or something like this that I already know. 我真的很想知道一些干净的方法(基于Linux),避免使用管道或类似的方法。 There are some library or external useful to share with us? 有一些图书馆或外部有用的东西可以与我们分享吗?

In shell: 在外壳中:

pydoc modulename | grep the-word

Example

$ pydoc os | grep chmod
chmod(...)
    chmod(path, mode)
fchmod(...)
    fchmod(fd, mode)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM