2017-01-26 1 views

답변

1

나를 위해 작동하는 해결책을 찾았습니다. 백그라운드에서 작업하는 과정이 필요하다는 것을 깨달았습니다. jupyter의 nbextension이 --py --sys 접두사 widgetsnbextension

from IPython.display import display 
from ipywidgets import Label 
from time import sleep 

import threading 

class App(object): 
    def __init__(self, nloops=2000): 
     self.nloops = nloops 
     self.pb = Label(description='Thread loops', value="0") 

    def start(self): 
     display(self.pb) 
     for i in range(10): 
      self.pb.value += str(i) 
      sleep(1) 

app = App(nloops=20000) 

t = threading.Thread(target=app.start) 

t.start() 

수 있도록 :

내가 먼저 위젯을 가능하게했다

관련 문제