Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,8 @@ import gradio as gr
|
|
| 2 |
import subprocess
|
| 3 |
|
| 4 |
def greet(command):
|
| 5 |
-
|
|
|
|
| 6 |
return f"{command} \n {output}"
|
| 7 |
|
| 8 |
demo = gr.Interface(fn=greet, inputs="textbox", outputs="textbox")
|
|
|
|
| 2 |
import subprocess
|
| 3 |
|
| 4 |
def greet(command):
|
| 5 |
+
commandList = command.split(' ')
|
| 6 |
+
output = subprocess.run(commandList, stdout=subprocess.PIPE).stdout.decode('utf-8')
|
| 7 |
return f"{command} \n {output}"
|
| 8 |
|
| 9 |
demo = gr.Interface(fn=greet, inputs="textbox", outputs="textbox")
|