agent scraper
This commit is contained in:
13
agent-py-bot/agents/runner.py
Normal file
13
agent-py-bot/agents/runner.py
Normal 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)}"
|
||||
|
||||
|
Reference in New Issue
Block a user