
Hi,
if I use this code
···
from bokeh.layouts import column
from bokeh.models import CustomJS, ColumnDataSource
from bokeh.plotting import Figure, show
from bokeh.models.widgets import Button
x = [x*0.005 for x in range(0, 200)]
y = x
nomeFileExcel=“file:/C:/Eclipse/eclipse-workspace/BiDia/src/mauro.xlsx”
source = ColumnDataSource(data=dict(x=x, y=y))
bottoneCallback = CustomJS(args=dict(source=source),
code=“”"
var A= ‘{0}’;
window.open(A);
“”" .format (str(nomeFileExcel)))
bottone=Button(label=“testo”,button_type=“success”,name=“nome”,callback=bottoneCallback)
layout = column(bottone)
show(layout)
All work very fine
BUT if I try to use the same code with Bokeh Server
from os.path import dirname, join
from bokeh.layouts import column
from bokeh.models import CustomJS, ColumnDataSource
from bokeh.plotting import Figure, show
from bokeh.models.widgets import Button
from bokeh.plotting import curdoc
x = [x*0.005 for x in range(0, 200)]
y = x
nomeFileExcel=“file:/C:/Eclipse/eclipse-workspace/BiDia/src/mauro.xlsx”
source = ColumnDataSource(data=dict(x=x, y=y))
bottoneCallback = CustomJS(args=dict(source=source),
code=“”"
var A= ‘{0}’;
window.open(A);
“”" .format (str(nomeFileExcel)))
bottone=Button(label=“testo”,button_type=“success”,name=“nome”,callback=bottoneCallback)
layout = column(bottone)
curdoc().add_root(layout)
http://localhost:5006/testWindowOpenServe
bokeh serve testWindowOpenServe
The file in not open and the console web tell me this errror:
Error: Access to ‘file:///C:/Eclipse/eclipse-workspace/BiDia/src/mauro.xlsx’ from script denied
In wich way I can do a window.open usinf Bokeh Server?
Kind regards
Mauro


