MCPcopy Create free account
hub / github.com/Singular/Singular / python_run

Function python_run

Singular/dyn_modules/pyobject/pyobject.cc:444–457  ·  view source on GitHub ↗

Execute string in python from Singular

Source from the content-addressed store, hash-verified

442
443/// Execute string in python from Singular
444BOOLEAN python_run(leftv result, leftv arg)
445{
446 if ( !arg || (arg->Typ() != STRING_CMD) )
447 {
448 WerrorS("expected python_run('string')");
449 return TRUE;
450 }
451
452 PyRun_SimpleString(reinterpret_cast<const char*>(arg->Data()));
453 sync_contexts();
454
455 Py_INCREF(Py_None);
456 return PythonCastStatic<>(Py_None).assign_to(result);
457}
458
459PythonObject names_from_module(const char* module_name)
460{

Callers

nothing calls this directly

Calls 5

WerrorSFunction · 0.85
sync_contextsFunction · 0.85
assign_toMethod · 0.80
TypMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected