from bokeh.models import Slider
from bokeh.models.widgets import Button
from bokeh.layouts import column
from bokeh.io import curdoc
import numpy as np
import pandas as pd
s = Slider(title="Value:", value = 0, step=1, end=1000,start=0)
update = Button(label='Update', width=20)
def update_value():
n=0
while n<10000:
list_slider111 = [0,1,0,0,0,0,0,0,0,0,0]
ar14 = np.array(list_slider111)
df14 = pd.DataFrame(ar14)
out_name="Nb_images.txt"
np.savetxt(out_name, df14, fmt='%1.2f', delimiter=",")
print(n)
s.value+=1
n+=1
print(n)
update.on_click(update_value)
curdoc().add_root(column(s,update))
This is one idea of my application. With my application there are a lot of things complicate in the for loops.
You can see, when the for loops finished, and the slider begins moving. How we can do it in parallel?