Singular Manual: python_run

  | ### 4.27.7 python_run `Syntax:` `python_run (` string_expression `)` `Type:` none `Purpose:` Executes python commands (given as a string) in `python` context and syncs the contexts afterwards. `Example:`
        LIB("pyobject.so");
        python_run("def newfunc(*args): return list(args)");
        newfunc(1, 2, 3);          // newfunc also known to SINGULAR now
      ==> [1, 2, 3]

        python_run("import os");
        os;
      ==> <module 'os' from '/usr/lib/python2.7/os.pyc'>
        attrib(os, "name");
      ==> 'posix'

User manual for Singular version 4-1-1p3, 2018, generated by texi2html.