mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
1439b72f66
* dataframe error fix * changelog * demo launch fix
16 lines
428 B
Python
16 lines
428 B
Python
import gradio as gr
|
|
|
|
with gr.Blocks() as demo:
|
|
count = gr.Slider(minimum=1, maximum=10, step=1, label="count")
|
|
data = gr.DataFrame(
|
|
headers=["A", "B"], col_count=(2, "fixed"), type="array", interactive=True
|
|
)
|
|
btn = gr.Button(value="click")
|
|
btn.click(
|
|
fn=lambda cnt: [[str(2 * i), str(2 * i + 1)] for i in range(int(cnt))],
|
|
inputs=[count],
|
|
outputs=[data],
|
|
)
|
|
|
|
demo.launch()
|