Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import subprocess
|
3 |
+
|
4 |
+
def run_mikobot():
|
5 |
+
# Run the Mikobot command
|
6 |
+
try:
|
7 |
+
# Capture the output of the command
|
8 |
+
result = subprocess.run(['python3', '-m', 'Mikobot'], capture_output=True, text=True, check=True)
|
9 |
+
return result.stdout # Return the standard output
|
10 |
+
except subprocess.CalledProcessError as e:
|
11 |
+
return f"Error: {e.stderr}" # Return the error output if the command fails
|
12 |
+
|
13 |
+
# Streamlit UI
|
14 |
+
st.title("Mikobot Runner")
|
15 |
+
|
16 |
+
if st.button("Run Flash"):
|
17 |
+
output = run_mikobot()
|
18 |
+
st.text_area("Output", output, height=300) # Display the output in a text area
|