Aarifkhan commited on
Commit
65e7fd0
·
verified ·
1 Parent(s): d4e24ff

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import gradio as gr
3
+
4
+ def terminal_emulator(command):
5
+ import subprocess
6
+ process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
7
+ output, error = process.communicate()
8
+ if error:
9
+ return error.decode()
10
+ return output.decode()
11
+
12
+ iface = gr.Interface(fn=terminal_emulator, inputs="text", outputs="text", title="Terminal Emulator")
13
+ iface.launch(share=True,debug=True)