MCPcopy Create free account
hub / github.com/apache/arrow / execute_python

Method execute_python

python/scripts/run_emscripten_tests.py:242–261  ·  view source on GitHub ↗
(self, code, wait_for_terminate=True)

Source from the content-addressed store, hash-verified

240 self.driver.get(self.url)
241
242 def execute_python(self, code, wait_for_terminate=True):
243 if wait_for_terminate:
244 self.driver.execute_async_script(
245 f"""
246 let callback = arguments[arguments.length-1];
247 python = `{code}`;
248 window.python_done_callback = callback;
249 window.pyworker.postMessage(
250 {{python, isatty: {'true' if sys.stdout.isatty() else 'false'}}});
251 """
252 )
253 else:
254 self.driver.execute_script(
255 f"""
256 let python = `{code}`;
257 window.python_done_callback= (x) => {{window.python_script_done=x;}};
258 window.pyworker.postMessage(
259 {{python,isatty:{'true' if sys.stdout.isatty() else 'false'}}});
260 """
261 )
262
263 def clear_logs(self):
264 self.driver.execute_script("window.python_logs = [];")

Callers 1

load_arrowMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected