Nov-08-2019, 02:30 PM
(This post was last modified: Nov-08-2019, 02:30 PM by Gribouillis.)
This is not a direct answer but as I work on Linux, I always have a terminal open on my desktop. I created a small program named 'pyman', so that when I type in the console for example
Output:pyman xmlrpc
it will open these search results in the default web browser. Here is this command's code. Enjoy the rich features #!/usr/bin/env python3 # -*-coding: utf8-*- # pyman -- program to browse python documentation. import argparse import webbrowser __version__ = '2019.11.8' def main(word, version): assert version in (2, 3) url = "https://docs.python.org/{}/search.html".format( version) + ('?q=' + word if word else '') webbrowser.open(url) if __name__ == '__main__': parser = argparse.ArgumentParser(description="Search python documentation") parser.add_argument('-v', '--version', dest='version', type=int, help='Python version 2 or 3. Defaults to 3.', default=3) parser.add_argument('word', metavar='WORD', help='The word to search', default='', nargs='?') ns = parser.parse_args() main(ns.word, ns.version)