-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathprogressbar_notebook.py
More file actions
executable file
·48 lines (37 loc) · 1.04 KB
/
Copy pathprogressbar_notebook.py
File metadata and controls
executable file
·48 lines (37 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python
# -*- coding: UTF8 -*-
"""
author: Guillaume Bouvier
email: guillaume.bouvier@ens-cachan.org
creation date: 2015 01 16
license: GNU GPL
Please feel free to use and modify this, but keep the above information.
Thanks!
"""
from IPython.display import HTML, Javascript, display
import uuid
class ProgressBar():
def __init__(self, widgets, maxval):
self.maxval = maxval
def start(self):
self.divid = str(uuid.uuid4())
pb = HTML(
"""
<div style="border: 1px solid black; width:500px">
<div id="%s" style="background-color:blue; width:0%%"> </div>
</div>
""" % self.divid)
display(pb)
def update(self, value):
modulo = self.maxval / 100
if value % modulo == 0:
display(Javascript("$('div#%s').width('%i%%')" % (self.divid, value*101/self.maxval)))
def finish(self):
print 'done'
return None
def Percentage():
return None
def Bar(marker,left,right):
return None
def ETA():
return None