(python_code, input_data)
| 3 | import random |
| 4 | |
| 5 | def run_python_code(python_code, input_data): |
| 6 | try: |
| 7 | process = subprocess.run( |
| 8 | ["python", "-c", python_code], |
| 9 | input=input_data.encode(), |
| 10 | capture_output=True, |
| 11 | text=True, |
| 12 | ) |
| 13 | return process.stdout.strip() |
| 14 | except Exception as e: |
| 15 | print(f"Error running Python code: {str(e)}") |
| 16 | return "" |
| 17 | |
| 18 | def run_javascript_code(js_code, input_data): |
| 19 | with open("temp.js", "w") as f: |
no outgoing calls
no test coverage detected