changxin commited on
Commit
9b1c0bb
1 Parent(s): 49e345a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -38,6 +38,9 @@ def fx_dax(s:str):
38
  s1=html.split('<div class="result">')[1]
39
  s2='<div class="result">'+s1.split('<a href')[0]+'<a href="https://pbihub.cn/users/44" target="_top"><img src="https://pbihub.cn/uploads/avatars/44_1536391253.jpg?imageView2/1/w/380/h/380" alt="万剑归宗" class="badge" width="380" height="380"></a>'
40
  return s2
 
 
 
41
 
42
  demo=gr.Blocks()
43
  with demo:
@@ -68,5 +71,12 @@ with demo:
68
  DAX_button=gr.Button("格式化>>")
69
  DAX_output=gr.HTML(label="DAX表达式格式化结果")
70
  DAX_button.click(fx_dax, inputs=DAX_input, outputs=DAX_output,api_name='DAX')
 
 
 
 
 
 
 
71
  demo.launch()
72
 
 
38
  s1=html.split('<div class="result">')[1]
39
  s2='<div class="result">'+s1.split('<a href')[0]+'<a href="https://pbihub.cn/users/44" target="_top"><img src="https://pbihub.cn/uploads/avatars/44_1536391253.jpg?imageView2/1/w/380/h/380" alt="万剑归宗" class="badge" width="380" height="380"></a>'
40
  return s2
41
+
42
+ def fx_datatable(s:str):
43
+ return exec(s)
44
 
45
  demo=gr.Blocks()
46
  with demo:
 
71
  DAX_button=gr.Button("格式化>>")
72
  DAX_output=gr.HTML(label="DAX表达式格式化结果")
73
  DAX_button.click(fx_dax, inputs=DAX_input, outputs=DAX_output,api_name='DAX')
74
+
75
+ with gr.TabItem("Python-Execute"):
76
+ gr.Markdown("# Python脚本测试")
77
+ d_input=gr.Textbox(label="请填写需要datatable库处理的脚本",lines=18)
78
+ d_output=gr.Textbox(label="输出>",lines=20)
79
+ d_button=gr.Button("开始编译>>")
80
+ d_button.click(fx_datatable, inputs=d_input, outputs=d_output,api_name='datatable')
81
  demo.launch()
82