Can anyone please help as to why this code is not working. I am new to bokeh and was trying out the customJS change on Pretext Object.
import pandas as pd
import numpy as np
from bokeh.models import ColumnDataSource, CustomJS, PreText
from bokeh.models.widgets import DataTable, NumberFormatter, TableColumn, Button
from bokeh.io import curdoc
from bokeh.plotting import show
from bokeh.layouts import column
import base64
import io
bt0 = Button(label='Click me')
not_yet_called = True
encodedData = None
data = None
df = None
def prepare_df():
global not_yet_called
bool (not_yet_called)
if not_yet_called:
not_yet_called = False
pretext.text="1"
else:
not_yet_called = True
pretext.text="2"
pretext=PreText(text='')
print(pretext.text)
pretext.js_on_change('text', CustomJS(code="""alert('Hello')"""))
pretext.text='abcd'
print(pretext.text)
bt0.on_click(prepare_df)
curdoc().add_root(bt0)