Made some chanages and now Can't remmebr what I did

This commit is contained in:
2026-07-23 04:55:36 +00:00
parent c8d645e9bd
commit 81e76b25d0
11 changed files with 513 additions and 415 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env python3
import subprocess
def run_command(command: str):
"""Executes a Linux command, waits for completion, and returns output."""
try:
# shell=True allows running full command strings with pipes/wildcards
# text=True returns strings instead of bytes
result = subprocess.run(
command, shell=True, check=True, capture_output=True, text=True
)
return {"success": True, "stdout": result.stdout, "stderr": result.stderr}
except subprocess.CalledProcessError as e:
# Handles errors if the Linux command returns a non-zero exit code
return {"success": False, "stdout": e.stdout, "stderr": e.stderr}