Update app.py
Browse files
app.py
CHANGED
@@ -139,6 +139,10 @@ def fx_dt(dc,x,y):
|
|
139 |
dt_button=gr.Button("分类汇总")
|
140 |
dt_button.click(fx_dt, inputs=dt_input, outputs=dt_output,api_name='datatable')
|
141 |
'''
|
|
|
|
|
|
|
|
|
142 |
demo=gr.Blocks(css="#jsc:hover{background-color: red;}")
|
143 |
with demo:
|
144 |
with gr.Tabs():
|
@@ -194,5 +198,9 @@ py_exe=d_t.to_pandas()'''
|
|
194 |
dt_button=gr.Button("转换日期>>")
|
195 |
dt_output=gr.Textbox(label='输出处理的日期字符串')
|
196 |
dt_button.click(fx_rq,dt_input,dt_output,api_name='date_chinese')
|
|
|
|
|
|
|
|
|
197 |
|
198 |
demo.launch()
|
|
|
139 |
dt_button=gr.Button("分类汇总")
|
140 |
dt_button.click(fx_dt, inputs=dt_input, outputs=dt_output,api_name='datatable')
|
141 |
'''
|
142 |
+
def upload_file(files):
|
143 |
+
file_paths = [file.name for file in files]
|
144 |
+
return file_paths
|
145 |
+
|
146 |
demo=gr.Blocks(css="#jsc:hover{background-color: red;}")
|
147 |
with demo:
|
148 |
with gr.Tabs():
|
|
|
198 |
dt_button=gr.Button("转换日期>>")
|
199 |
dt_output=gr.Textbox(label='输出处理的日期字符串')
|
200 |
dt_button.click(fx_rq,dt_input,dt_output,api_name='date_chinese')
|
201 |
+
with gr.TabItem("上传按钮测试"):
|
202 |
+
file_output = gr.File()
|
203 |
+
upload_button = gr.UploadButton("点击上传文件...", file_types=["image", "video"], file_count="multiple")
|
204 |
+
upload_button.upload(upload_file, upload_button, file_output)
|
205 |
|
206 |
demo.launch()
|