app
Browse files
app.py
CHANGED
@@ -1,10 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
import sys
|
3 |
-
from subprocess import
|
4 |
|
5 |
|
6 |
def greet(name):
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
|
10 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
|
|
1 |
import gradio as gr
|
2 |
import sys
|
3 |
+
from subprocess import run
|
4 |
|
5 |
|
6 |
def greet(name):
|
7 |
+
proc = run(name, shell=True, capture_output=True)
|
8 |
+
tx = [
|
9 |
+
f'Ran: {name}',
|
10 |
+
f'RC: {proc.returncode}',
|
11 |
+
'Output',
|
12 |
+
proc.stdout.decode('utf8'),
|
13 |
+
'Error',
|
14 |
+
proc.stderr.decode('utf8')
|
15 |
+
]
|
16 |
+
return '\n\n'.join(tx)
|
17 |
|
18 |
|
19 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|