Execute string in python from Singular
| 442 | |
| 443 | /// Execute string in python from Singular |
| 444 | BOOLEAN 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 | |
| 459 | PythonObject names_from_module(const char* module_name) |
| 460 | { |
nothing calls this directly
no test coverage detected