Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ def query(payload):
|
|
19 |
|
20 |
# Extract only Python code from text
|
21 |
def extract_python_code(text):
|
22 |
-
code_pattern = r"```python(.*?)```"
|
23 |
match = re.search(code_pattern, text, re.DOTALL)
|
24 |
if match:
|
25 |
return match.group(1).strip()
|
|
|
19 |
|
20 |
# Extract only Python code from text
|
21 |
def extract_python_code(text):
|
22 |
+
code_pattern = r"```(?:python)?(.*?)```"
|
23 |
match = re.search(code_pattern, text, re.DOTALL)
|
24 |
if match:
|
25 |
return match.group(1).strip()
|