Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import subprocess
|
2 |
+
|
3 |
+
def execute_command(command):
|
4 |
+
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
5 |
+
return result.stdout, result.stderr
|
6 |
+
|
7 |
+
if __name__ == "__main__":
|
8 |
+
# Esempio di comando da eseguire
|
9 |
+
stdout, stderr = execute_command("echo 'Hello, World!'")
|
10 |
+
print("Output:", stdout)
|
11 |
+
if stderr:
|
12 |
+
print("Errors:", stderr)
|