Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|