File size: 413 Bytes
a221723
 
b93d7b6
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import streamlit as st

command = st.text_input("Command: ", "")
commandList = command.split(' ')
if(commandList[0] == "cd"):
    os.chdir(commandList[1])
    output = subprocess.run(['pwd'], stdout=subprocess.PIPE).stdout.decode('utf-8')
    st.write(f"{command}: \n {output}")
else:
    output = subprocess.run(commandList, stdout=subprocess.PIPE).stdout.decode('utf-8')
    st.write(f"{command}: \n {output}")