File size: 371 Bytes
284a19a
 
 
9086143
 
 
284a19a
 
9086143
 
 
 
 
 
284a19a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python

import gradio as gr
import pandas as pd

df_empty = pd.DataFrame([], columns=['a', 'b'])

with gr.Blocks() as demo:
    df = gr.Dataframe(interactive=False)
    btn = gr.Button()
    text = gr.Textbox()
    btn.click(fn=lambda x: (gr.update(value=df_empty), len(x)),
              inputs=df,
              outputs=[df, text])
demo.queue().launch()