Update app.py
Browse files
app.py
CHANGED
@@ -20,8 +20,8 @@ def handle_command(command):
|
|
20 |
# 切换到工作目录
|
21 |
os.chdir(WORKING_DIR)
|
22 |
|
23 |
-
#
|
24 |
-
process = subprocess.Popen(
|
25 |
while True:
|
26 |
output = process.stdout.readline()
|
27 |
if output == '' and process.poll() is not None:
|
|
|
20 |
# 切换到工作目录
|
21 |
os.chdir(WORKING_DIR)
|
22 |
|
23 |
+
# 执行命令并捕获输出
|
24 |
+
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
25 |
while True:
|
26 |
output = process.stdout.readline()
|
27 |
if output == '' and process.poll() is not None:
|