{
    "mode": "pydoc",
    "parameter": "readline",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/readline/json",
    "generated": "2026-06-02T15:03:57Z",
    "sections": {
        "NAME": {
            "content": "readline - Importing this module enables command line editing using GNU readline.\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/readline.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "add_history",
                    "content": "Add an item to the history buffer.\n"
                },
                {
                    "name": "append_history_file",
                    "content": "Append the last nelements items of the history list to file.\n\nThe default filename is ~/.history.\n"
                },
                {
                    "name": "clear_history",
                    "content": "Clear the current readline history.\n"
                },
                {
                    "name": "get_begidx",
                    "content": "Get the beginning index of the completion scope.\n"
                },
                {
                    "name": "get_completer",
                    "content": "Get the current completer function.\n"
                },
                {
                    "name": "get_completer_delims",
                    "content": "Get the word delimiters for completion.\n"
                },
                {
                    "name": "get_completion_type",
                    "content": "Get the type of completion being attempted.\n"
                },
                {
                    "name": "get_current_history_length",
                    "content": "Return the current (not the maximum) length of history.\n"
                },
                {
                    "name": "get_endidx",
                    "content": "Get the ending index of the completion scope.\n"
                },
                {
                    "name": "get_history_item",
                    "content": "Return the current contents of history item at one-based index.\n"
                },
                {
                    "name": "get_history_length",
                    "content": "Return the maximum number of lines that will be written to the history file.\n"
                },
                {
                    "name": "get_line_buffer",
                    "content": "Return the current contents of the line buffer.\n"
                },
                {
                    "name": "insert_text",
                    "content": "Insert text into the line buffer at the cursor position.\n"
                },
                {
                    "name": "parse_and_bind",
                    "content": "Execute the init line provided in the string argument.\n"
                },
                {
                    "name": "read_history_file",
                    "content": "Load a readline history file.\n\nThe default filename is ~/.history.\n"
                },
                {
                    "name": "read_init_file",
                    "content": "Execute a readline initialization file.\n\nThe default filename is the last filename used.\n"
                },
                {
                    "name": "redisplay",
                    "content": "Change what's displayed on the screen to reflect contents of the line buffer.\n"
                },
                {
                    "name": "remove_history_item",
                    "content": "Remove history item given by its zero-based position.\n"
                },
                {
                    "name": "replace_history_item",
                    "content": "Replaces history item given by its position with contents of line.\n\npos is zero-based.\n"
                },
                {
                    "name": "set_auto_history",
                    "content": "Enables or disables automatic history.\n"
                },
                {
                    "name": "set_completer",
                    "content": "Set or remove the completer function.\n\nThe function is called as function(text, state),\nfor state in 0, 1, 2, ..., until it returns a non-string.\nIt should return the next possible completion starting with 'text'.\n"
                },
                {
                    "name": "set_completer_delims",
                    "content": "Set the word delimiters for completion.\n"
                },
                {
                    "name": "set_completion_display_matches_hook",
                    "content": "Set or remove the completion display function.\n\nThe function is called as\nfunction(substitution, [matches], longestmatchlength)\nonce each time matches need to be displayed.\n"
                },
                {
                    "name": "set_history_length",
                    "content": "Set the maximal number of lines which will be written to the history file.\n\nA negative length is used to inhibit history truncation.\n"
                },
                {
                    "name": "set_pre_input_hook",
                    "content": "Set or remove the function invoked by the rlpreinputhook callback.\n\nThe function is called with no arguments after the first prompt\nhas been printed and just before readline starts reading input\ncharacters.\n"
                },
                {
                    "name": "set_startup_hook",
                    "content": "Set or remove the function invoked by the rlstartuphook callback.\n\nThe function is called with no arguments just\nbefore readline prints the first prompt.\n"
                },
                {
                    "name": "write_history_file",
                    "content": "Save a readline history file.\n\nThe default filename is ~/.history.\n"
                }
            ]
        },
        "FILE": {
            "content": "/usr/lib/python3.10/lib-dynload/readline.cpython-310-x8664-linux-gnu.so\n\n",
            "subsections": []
        }
    },
    "summary": "readline - Importing this module enables command line editing using GNU readline.",
    "flags": [],
    "examples": [],
    "see_also": []
}