Spaces:
Runtime error
Runtime error
Update app.py
Browse files18 unmodified lines1920212223242518 unmodified lines# Extract only Python code from textdef extract_python_code(text):code_pattern = r"```python(.*?)```"match = re.search(code_pattern, text, re.DOTALL)if match:return match.group(1).strip()18 unmodified lines1920212223242518 unmodified lines# Extract only Python code from textdef extract_python_code(text):code_pattern = r"```(?:python)?(.*?)```"match = re.search(code_pattern, text, re.DOTALL)if match:return match.group(1).strip()
app.py+1-1