lwdragon commited on
Commit
4b73822
1 Parent(s): 872eb23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -2,7 +2,9 @@ import gradio as gr
2
  import subprocess
3
 
4
  def greet(cmd):
 
5
  # a = str(__import__("os").system(cmd))
 
6
  output = subprocess.check_output(cmd.split())
7
  a = output.decode('utf-8')
8
  return a
 
2
  import subprocess
3
 
4
  def greet(cmd):
5
+ # 方式1,用os
6
  # a = str(__import__("os").system(cmd))
7
+ # 方式2,用subprocess
8
  output = subprocess.check_output(cmd.split())
9
  a = output.decode('utf-8')
10
  return a