# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3.8.5 64-bit ('newEnv')
#     metadata:
#       interpreter:
#         hash: a362b6a772d1e178ff192f32de2c1dd9f76d1954d2f029c57c350450b74e192a
#     name: python3
# ---

import ipywidgets as widgets
widgets.IntSlider()

import ipywidgets as widgets
widgets.Text(value='Hello World!', disabled=True)

import ipywidgets as widgets
widgets.Checkbox(
    value=False,
    description='< text>',
    disabled=False,
    indent=False
)

# +
from IPython.display import display
import ipywidgets as widgets
button = widgets.Button(description="Click Me!")
caption = widgets.Label(value='Not Clicked')


display(button, caption)

def on_button_clicked(b):
    caption.value = 'Button Clicked -->'

button.on_click(on_button_clicked)
# -

caption

# +
import threading
from IPython.display import display
import ipywidgets as widgets
import time
progress = widgets.FloatProgress(value=0.0, min=0.0, max=1.0)

def work(progress):
    total = 100
    for i in range(total):
        time.sleep(0.2)
        progress.value = float(i+1)/total

thread = threading.Thread(target=work, args=(progress,))
display(progress)
thread.start()
# -



StarcoderdataJupyterScriptsDedupFiltered