prof-2 / app.py
Rathalos's picture
Create app.py
51c29b8 verified
raw
history blame contribute delete
373 Bytes
import subprocess
def execute_command(command):
result = subprocess.run(command, shell=True, capture_output=True, text=True)
return result.stdout, result.stderr
if __name__ == "__main__":
# Esempio di comando da eseguire
stdout, stderr = execute_command("echo 'Hello, World!'")
print("Output:", stdout)
if stderr:
print("Errors:", stderr)