简体   繁体   中英

python bokeh FileInput text

The default text on the bokeh FileInput is "Choose File".

Is there a way i can change this text, eg to "Upload image"?

from bokeh.io import curdoc
from bokeh.models.widgets import FileInput

def upload_fit_data(attr, old, new):
    print("fit data upload succeeded")
    print(file_input.value)
file_input = FileInput(accept=".jpg")
file_input.on_change('value', upload_fit_data)

doc=curdoc()
doc.add_root(file_input)

As of Bokeh 1.4 this is not configurable. Seem like a reasonable ask (and also would be a good task for a new contributor) so I'd encourage you to make a new issue about it .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM