autocomplete - Python readline module: Set 2 character delimiter -
I am using the I want to set a 2 character delimiter, but by setting The problem is, now I am entering the first name which is present multiple times, with different names. Instead of suggesting all the possible last names of completion, Readline thinks that the white space's character is a delimiter, and again starts suggesting all the names. How can I solve this problem? Further information: I am already using a custom completion function: The problem is not that The function works incorrectly, I debug it and when a word was completed that ends with a white space (like You probably have to use it from Python Doctor: "State the integer function as 0, 1, 2, ... as the function (text, state) It is said, unless it returns a non-string value. It should be returned to the next possible completion, starting with the text. " readline module to auto-complete names (first name last Name).
readline.set_completer_delims (',') , it accepts the comma and the white space as a delimiter . But I only want combination.
# Configure and Enable Tab Full Def Full (Text , State): "" "Contact integer work for readline module" option = [x [2] .strip () for contacts in x if x [2] .mount (.with startwith (text.strip () Less ()) Try: Return option [state] + ',' except index error: Return any readline.set_completer (full)
"simon" ), then
text "simon" instead of
"" .
readline.set_completer ([ Function])
Comments
Post a Comment