In this direction works even if everything is in same cell. But what I need 
is reading the value in the for loop, and if I changed the value in 
javascript I want to see it. 

In that example I'm just displaying the value of slider. If you move the 
slider during the loop, the fs.value won't change. This is my problem. 

On Wednesday, July 13, 2016 at 5:03:07 PM UTC+2, Hai Nguyen wrote:
>
> you can try this
>
> # 1st cell
> import ipywidgets
>
> fslider = ipywidgets.FloatSlider(max=10, min=0)
> fslider
>
> # 2nd cell
> import time
>
> for i in range(8):
>     fslider.value = i
>     time.sleep(0.2)
>
>
> Hai
>
> On Wed, Jul 13, 2016 at 9:40 AM, Attila Bagoly <[email protected] 
> <javascript:>> wrote:
>
>> Hi!
>>
>> I'm working on interactive interface (using ipywidgets) for a machine 
>> learning library in jupyter. I have a function with a big loop (training 
>> loop) which blocks the main thread (I can't put this loop to a different 
>> thread) and therefore I can't interact with server during the training.
>>
>>
>> I made a simple example:
>>
>> from time import sleep
>> from ipywidgets import widgets 
>> from IPython.display import display 
>>
>>
>> fs = widgets.FloatSlider(max=100, value=0)
>> display(fs)
>> for i in range(10):
>>     display(fs.value)
>>     sleep(1) 
>>
>> Here I won't see the change in fs.value until the loop ended. How can I 
>> force IPython to synchronize the fs.value in every iteration?
>>
>> Attila
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jupyter/f0b55a1c-7127-479d-804c-48c041d29b24%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jupyter/f0b55a1c-7127-479d-804c-48c041d29b24%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/f957217b-f862-4243-b820-6fe8ba8c0d8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to