Nothing happens

Hello,
i am learning how to use bokeh. i do not know what is fundamentally wrong as nothing happens. I want to input something in the PasswordInput widget and see the output in TextInput. Nothing happens. please help.

import pandas as pd
import numpy as np
from bokeh.models import ColumnDataSource,PasswordInput,TextInput
from bokeh.io import curdoc
from bokeh.layouts import row

df_stocks = pd.read_csv('nse_stocks_list.csv')

# section to define callback for widgest
def callback(attr,old,new):
    val=PasswordInput_api_key.value
    text_key.value=val
    text_key.visible=True
    
# initialize widgests
PasswordInput_api_key=PasswordInput(title="Enter your API Key",value="")
text_key=TextInput(title="You entered API Key:",value="",visible=False)


#widget change callback
PasswordInput_api_key.on_change('value',callback)

layout=row(PasswordInput_api_key,text_key)

curdoc().add_root(layout)

Hi @soumya_chowdhury we really need more information. E.g. “nothing happens” could mean nothing at at shows up in the browser, or it could mean things show up in the browser, but there’s no reaction when widgets or used, or something else entirely. What exactly do you mean in this instance? Please be specific and detailed. We also need to know exactly what command you ran. This is a Bokeh server app, did you run it with the bokeh serve command? Or did you try to run it as a regular python script?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.