{
    "content": [
        {
            "type": "text",
            "text": "# select (pydoc)\n\n## TLDR\n\n> Bash builtin construct for creating menus.\n\n- Create a menu out of individual words:\n  `select {{word}} in {{apple orange pear banana}}; do echo ${{word}}; done`\n- Create a menu from the output of another command:\n  `select {{line}} in $({{command}}); do echo ${{line}}; done`\n- Specify the prompt string for `select` and create a menu for picking a file or folder from the current directory:\n  `PS3=\"{{Select a file: }}\"; select {{file}} in *; do echo ${{file}}; done`\n- Create a menu from a Bash array:\n  `{{fruits}}=({{apple orange pear banana}}); select {{word}} in ${{{fruits[@}}}; do echo ${{word}}; done`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** select - This module supports asynchronous I/O on multiple file descriptors.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (3 lines)\n- **CLASSES** (3 lines) — 1 subsections\n  - class epoll (79 lines)\n- **FUNCTIONS** (1 lines) — 2 subsections\n  - poll (5 lines)\n  - select (23 lines)\n- **DATA** (29 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nselect - This module supports asynchronous I/O on multiple file descriptors.\n\n### DESCRIPTION\n\n* IMPORTANT NOTICE *\nOn Windows, only sockets are supported; on Unix, all file descriptors.\n\n### CLASSES\n\nbuiltins.object\nepoll\n\n#### class epoll\n\n|  select.epoll(sizehint=-1, flags=0)\n|\n|  Returns an epolling object\n|\n|  sizehint must be a positive integer or -1 for the default size. The\n|  sizehint is used to optimize internal data structures. It doesn't limit\n|  the maximum number of monitored events.\n|\n|  Methods defined here:\n|\n|  enter(self, /)\n|\n|  exit(self, exctype=None, excvalue=None, exctb=None, /)\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  close(self, /)\n|      Close the epoll control file descriptor.\n|\n|      Further operations on the epoll object will raise an exception.\n|\n|  fileno(self, /)\n|      Return the epoll control file descriptor.\n|\n|  modify(self, /, fd, eventmask)\n|      Modify event mask for a registered file descriptor.\n|\n|      fd\n|        the target file descriptor of the operation\n|      eventmask\n|        a bit set composed of the various EPOLL constants\n|\n|  poll(self, /, timeout=None, maxevents=-1)\n|      Wait for events on the epoll file descriptor.\n|\n|        timeout\n|          the maximum time to wait in seconds (as float);\n|          a timeout of None or -1 makes poll wait indefinitely\n|        maxevents\n|          the maximum number of events returned; -1 means no limit\n|\n|      Returns a list containing any descriptors that have events to report,\n|      as a list of (fd, events) 2-tuples.\n|\n|  register(self, /, fd, eventmask=7)\n|      Registers a new fd or raises an OSError if the fd is already registered.\n|\n|        fd\n|          the target file descriptor of the operation\n|        eventmask\n|          a bit set composed of the various EPOLL constants\n|\n|      The epoll interface supports all file descriptors that support poll.\n|\n|  unregister(self, /, fd)\n|      Remove a registered file descriptor from the epoll object.\n|\n|      fd\n|        the target file descriptor of the operation\n|\n|  ----------------------------------------------------------------------\n|  Class methods defined here:\n|\n|  fromfd(fd, /) from builtins.type\n|      Create an epoll object from a given control fd.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  closed\n|      True if the epoll handler is closed\n\n### FUNCTIONS\n\n#### poll\n\nReturns a polling object.\n\nThis object supports registering and unregistering file descriptors, and then\npolling them for I/O events.\n\n#### select\n\nWait until one or more file descriptors are ready for some kind of I/O.\n\nThe first three arguments are iterables of file descriptors to be waited for:\nrlist -- wait until ready for reading\nwlist -- wait until ready for writing\nxlist -- wait for an \"exceptional condition\"\nIf only one kind of condition is required, pass [] for the other lists.\n\nA file descriptor is either a socket or file object, or a small integer\ngotten from a fileno() method call on one of those.\n\nThe optional 4th argument specifies a timeout in seconds; it may be\na floating point number to specify fractions of seconds.  If it is absent\nor None, the call will never time out.\n\nThe return value is a tuple of three lists corresponding to the first three\narguments; each contains the subset of the corresponding file descriptors\nthat are ready.\n\n* IMPORTANT NOTICE *\nOn Windows, only sockets are supported; on Unix, all file\ndescriptors can be used.\n\n### DATA\n\nEPOLLERR = 8\nEPOLLET = 2147483648\nEPOLLEXCLUSIVE = 268435456\nEPOLLHUP = 16\nEPOLLIN = 1\nEPOLLMSG = 1024\nEPOLLONESHOT = 1073741824\nEPOLLOUT = 4\nEPOLLPRI = 2\nEPOLLRDBAND = 128\nEPOLLRDHUP = 8192\nEPOLLRDNORM = 64\nEPOLLWRBAND = 512\nEPOLLWRNORM = 256\nEPOLLCLOEXEC = 524288\nPIPEBUF = 4096\nPOLLERR = 8\nPOLLHUP = 16\nPOLLIN = 1\nPOLLMSG = 1024\nPOLLNVAL = 32\nPOLLOUT = 4\nPOLLPRI = 2\nPOLLRDBAND = 128\nPOLLRDHUP = 8192\nPOLLRDNORM = 64\nPOLLWRBAND = 512\nPOLLWRNORM = 256\n\n### FILE\n\n(built-in)\n\n"
        }
    ],
    "structuredContent": {
        "command": "select",
        "section": "",
        "mode": "pydoc",
        "summary": "select - This module supports asynchronous I/O on multiple file descriptors.",
        "synopsis": null,
        "tldr_summary": "Bash builtin construct for creating menus.",
        "tldr_examples": [
            {
                "description": "Create a menu out of individual words",
                "command": "select {{word}} in {{apple orange pear banana}}; do echo ${{word}}; done"
            },
            {
                "description": "Create a menu from the output of another command",
                "command": "select {{line}} in $({{command}}); do echo ${{line}}; done"
            },
            {
                "description": "Specify the prompt string for `select` and create a menu for picking a file or folder from the current directory",
                "command": "PS3=\"{{Select a file: }}\"; select {{file}} in *; do echo ${{file}}; done"
            },
            {
                "description": "Create a menu from a Bash array",
                "command": "{{fruits}}=({{apple orange pear banana}}); select {{word}} in ${{{fruits[@}}}; do echo ${{word}}; done"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 3,
                "subsections": [
                    {
                        "name": "class epoll",
                        "lines": 79
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "poll",
                        "lines": 5
                    },
                    {
                        "name": "select",
                        "lines": 23
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}