Q:

How to communicate between python and html page using flask framework? 

I am building a web-app on top of hadoop(its for internal use) using python's flask framework using jinja2 templates.  I have a requirement where I need to communicate/do some changes on existing html.  I am  not sure how to do that. 
The only way I know is to use:
render_template('xyz.html',some_vale=some_value)

But this will render the template again. 
Following are the task that I need to achieve:

The requirement would be to pop up a bootstrap toast when I get an acknowledgement that the data is inserted into hive successfully.  I do not want to use flash module in flask. 
One more requirement is to show/hide loading dialog while I fetch the data from database.  Once the search request is initiated, till the data is fetched, the dialog should be visible and then it should disappear. 

How can talk to HTML from python like we do in java script using id.
Appreciate the help. 

A:

Sounds like you need to create a separate endpoint for API-like request, fire AJAX request from displayed page, and do appropriate actions on success/failure. 

How can talk to HTML from python like we do in java script using id.

No.  Flask generates web pages from templates and data you pass to it.  You need to undertand a difference between what is done on server side and what is done on client side.