PhoenixStormJr commited on
Commit
b93d7b6
·
verified ·
1 Parent(s): eb39f8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -1,5 +1,11 @@
1
  import streamlit as st
2
 
3
- user_input = st.text_input("label goes here", "")
4
- x = st.slider('Select a value')
5
- st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
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}")