bug-fix: fixing sub-process
Browse files
app.py
CHANGED
@@ -13,10 +13,13 @@ def generate_html(text_input, length):
|
|
13 |
"--text", text_input,
|
14 |
"--length", str(length)
|
15 |
]
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
20 |
|
21 |
# Function to find the latest HTML file in the specified directory
|
22 |
def find_latest_html_file(base_path):
|
|
|
13 |
"--text", text_input,
|
14 |
"--length", str(length)
|
15 |
]
|
16 |
+
try:
|
17 |
+
# Capture the standard error output
|
18 |
+
result = subprocess.run(command, check=True, text=True, capture_output=True)
|
19 |
+
return find_latest_html_file('output')
|
20 |
+
except subprocess.CalledProcessError as e:
|
21 |
+
print("Error:", e.stderr) # Print the error message from stderr
|
22 |
+
return None
|
23 |
|
24 |
# Function to find the latest HTML file in the specified directory
|
25 |
def find_latest_html_file(base_path):
|