changxin commited on
Commit
770a12f
1 Parent(s): 337c28c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -49,8 +49,7 @@ def fx_datatable(code:str):
49
  namespace = {}
50
  fun = compile(code,'<string>','exec')
51
  exec(fun,namespace)
52
- with pd.ExcelWriter('data.xlsx') as pd_table:
53
- return namespace['py_exe'],namespace['py_exe'].to_excel(pd_table,index=False)
54
  '''
55
  def fx_dd(tk:str,s:str):
56
  headers= {"Content-Type": "application/json"}
@@ -134,7 +133,7 @@ d_t=DT[:,sum(f.销量),by('小组')]
134
  py_exe=d_t.to_pandas()'''
135
  d_input=gr.Textbox(label="请填写需要datatable库处理的脚本(最终输出使用变量名py_exe)",lines=18,value=test_code)
136
  d_button=gr.Button("开始编译>>")
137
- d_output=[gr.DataFrame(label="输出>",overflow_row_behaviour="paginate"),gr.File()]
138
  d_button.click(fx_datatable, inputs=d_input, outputs=d_output,api_name='pyexe')
139
 
140
  with gr.TabItem("js"):
 
49
  namespace = {}
50
  fun = compile(code,'<string>','exec')
51
  exec(fun,namespace)
52
+ return namespace['py_exe']
 
53
  '''
54
  def fx_dd(tk:str,s:str):
55
  headers= {"Content-Type": "application/json"}
 
133
  py_exe=d_t.to_pandas()'''
134
  d_input=gr.Textbox(label="请填写需要datatable库处理的脚本(最终输出使用变量名py_exe)",lines=18,value=test_code)
135
  d_button=gr.Button("开始编译>>")
136
+ d_output=gr.DataFrame(label="输出>",overflow_row_behaviour="paginate")
137
  d_button.click(fx_datatable, inputs=d_input, outputs=d_output,api_name='pyexe')
138
 
139
  with gr.TabItem("js"):