changxin commited on
Commit
9fed53d
1 Parent(s): 6519cb5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -51,8 +51,8 @@ def fx_datatable(code:str):
51
  exec(fun,namespace)
52
  return namespace['py_exe']
53
 
54
- def xz():
55
- x=pd.DataFrame([{'姓名':'畅心','成绩':100}])
56
  y=x.to_excel('statics/test.xlsx',index=False)
57
  return 'statics/test.xlsx'
58
 
@@ -161,7 +161,7 @@ py_exe=d_t.to_pandas()'''
161
  gr.HTML(S)
162
  with gr.TabItem("下载测试"):
163
  with gr.Row():
164
- xz_button=gr.Button("初始化>>")
165
- xz_button.click(xz,[], gr.File(),api_name='xz')
166
 
167
  demo.launch()
 
51
  exec(fun,namespace)
52
  return namespace['py_exe']
53
 
54
+ def xz(a):
55
+ x=pd.DataFrame([a])
56
  y=x.to_excel('statics/test.xlsx',index=False)
57
  return 'statics/test.xlsx'
58
 
 
161
  gr.HTML(S)
162
  with gr.TabItem("下载测试"):
163
  with gr.Row():
164
+ xz_button=gr.Button("绑定下载资源>>")
165
+ xz_button.click(xz,gr.JSON(label="请输入需要导出的数据字典信息"), gr.File(label="输出下载资源"),api_name='xz')
166
 
167
  demo.launch()