Answers for "how does the autocomplete work"

0

autocomplete

<form autocomplete="off" ...>
Posted by: Guest on June-18-2021
0

how to give autocomplete in python

import readline
readline.parse_and_bind("tab: complete")

def complete(text,state):
    volcab = ['dog','cat','rabbit','bird','slug','snail']
    results = [x for x in volcab if x.startswith(text)] + [None]
    return results[state]

readline.set_completer(complete)

line = input('prompt> ')
Posted by: Guest on August-02-2021

Browse Popular Code Answers by Language