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