PhoenixStormJr commited on
Commit
729cd7f
1 Parent(s): 187b3b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -6,11 +6,17 @@ import os
6
  command = st.text_input("Command: ", "")
7
  commandList = command.split(' ')
8
 
9
- if(commandList[0] == "cd"):
10
- os.chdir(commandList[1])
11
- output = subprocess.run(['pwd'], stdout=subprocess.PIPE).stdout.decode('utf-8')
12
- st.write(f"{command}: \n {output}")
13
- else:
14
- st.write(f"\"{command}\"")
15
- output = subprocess.run(commandList, stdout=subprocess.PIPE).stdout.decode('utf-8')
16
- st.write(f"{command}: \n {output}")
 
 
 
 
 
 
 
6
  command = st.text_input("Command: ", "")
7
  commandList = command.split(' ')
8
 
9
+ if(len(command) > 0):
10
+ if(commandList[0] == "cd"):
11
+ os.chdir(commandList[1])
12
+ output = subprocess.run(['pwd'], stdout=subprocess.PIPE).stdout.decode('utf-8')
13
+ st.write(f"{command}: \n {output}")
14
+ outputList = output.split("\n")
15
+ for out in outputList:
16
+ st.write(f"{out}")
17
+ else:
18
+ output = subprocess.run(commandList, stdout=subprocess.PIPE).stdout.decode('utf-8')
19
+ st.write(f"{command}: \n {output}")
20
+ outputList = output.split("\n")
21
+ for out in outputList:
22
+ st.write(f"{out}")