File size: 728 Bytes
4cf88e8 |
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 |
import gradio as gr
import random
with gr.Blocks() as test:
list_2 = ["choix21", "choix 22", "et choix 23"]
with gr.Row():
with gr.Accordion("See Details") as grac:
gr.Markdown("lorem ipsum")
hide_btn = gr.Button("hide")
show_btn = gr.Button("show")
def hide_fn():
update_ = {
grac: gr.update(open=False)
}
return update_
def show_fn():
update_ = {
grac: gr.update(open=True)
}
return update_
hide_btn.click(hide_fn,
inputs=[],
outputs=[grac])
show_btn.click(show_fn,
inputs=[],
outputs=[grac])
if __name__ == "__main__":
test.launch()
|