File size: 756 Bytes
023343f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr

def handler(in1, in2):
    return in1, in2

in1=gr.CheckboxGroup(label='擅長的程式語言1', 
                     info='可複選',
                     choices=['Python', 'C#', 'C++', 'Java'],
                     value=['Python', 'C++'])
in2=gr.CheckboxGroup(label='擅長的程式語言2', 
                     info='可複選',
                     choices=['PHP', 'ASP', 'JSP'],
                     value=['PHP', 'ASP'],
                     type='index')
out1=gr.Textbox(label='擅長的程式語言1')
out2=gr.Textbox(label='擅長的程式語言2')
iface=gr.Interface(
    fn=handler,
    inputs=[in1, in2],  
    outputs=[out1, out2],
    title='Checkbox 元件測試',
    allow_flagging='never',
    )
iface.launch()