Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
command = st.text_input("Command: ", "")
|
4 |
+
commandList = command.split(' ')
|
5 |
+
if(commandList[0] == "cd"):
|
6 |
+
os.chdir(commandList[1])
|
7 |
+
output = subprocess.run(['pwd'], stdout=subprocess.PIPE).stdout.decode('utf-8')
|
8 |
+
st.write(f"{command}: \n {output}")
|
9 |
+
else:
|
10 |
+
output = subprocess.run(commandList, stdout=subprocess.PIPE).stdout.decode('utf-8')
|
11 |
+
st.write(f"{command}: \n {output}")
|