VOOZH about

URL: https://www.geeksforgeeks.org/python/autocomplete-input-suggestion-using-python-and-flask/

⇱ Autocomplete input suggestion using Python and Flask - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Autocomplete input suggestion using Python and Flask

Last Updated : 9 Apr, 2021

In this article, we will learn how to give features like auto-completion to the data that is passed from Flask. Autocomplete basically means predicting the rest of the word when the user types something. This way human interaction also increases with every correct prediction. Let's see how to do the same.

We will be using jquery for autocompletion.

Installation :

To install flask type the below command in the terminal.

pip install flask

First, create a new directory for the project. Inside that create a new file and name it app.py.

app.py

Then, create a new directory inside the project to hold all the HTML files and name them templates. In this file, we have an input field where the user will type a string and the jquery function will provide the suggestions.

index.html

To run this app open cmd or terminal and run the below command.

python app.py

Output:

👁 flask autocomplete
Comment
Article Tags:
Article Tags: