agent scraper

This commit is contained in:
Dobromir Popov
2023-12-23 00:41:19 +00:00
parent 73803096b0
commit 317a876ec4
7 changed files with 132 additions and 14 deletions

View File

@ -0,0 +1,13 @@
import subprocess
import re
def execute_python_code(code_block):
try:
result = subprocess.run(['python', '-c', code_block],
capture_output=True, text=True, timeout=5)
return result.stdout or result.stderr
except Exception as e:
return f"Execution error: {str(e)}"