SuCicada's picture
test
290790d
import os
import subprocess
import sys
# Run shell command and capture output in real-time
def init():
process = subprocess.Popen("""
bash ./run.sh
""", stdout=subprocess.PIPE, shell=True)
while True:
output = process.stdout.readline().decode()
if output == '' and process.poll() is not None:
break
if output:
print(output.strip())
# Wait for the command to finish and get the return code
return_code = process.poll()
print(f"Command exited with return code {return_code}")
is_space = os.getenv("SYSTEM") == "spaces"
if is_space:
init()