Top
Back: python_import
Forward: countedref
FastBack: pyobject operations
FastForward: countedref
Up: pyobject related functions
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

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");
==> no pyobject support
  python_run("def newfunc(*args): return list(args)");
==>    ? `python_run` is not defined
==>    ? error occurred in or before ./examples/python_run.sing line 2: `  py\
   thon_run("def newfunc(*args): return list(args)");`
  newfunc(1, 2, 3);          // newfunc also known to SINGULAR now
==>    ? `newfunc(1,2,3)` is undefined
==>    ? error occurred in or before ./examples/python_run.sing line 3: `  ne\
   wfunc(1, 2, 3);          // newfunc also known to SINGULAR now`

  python_run("import os");
==>    ? `python_run` is not defined
==>    ? error occurred in or before ./examples/python_run.sing line 5: `  py\
   thon_run("import os");`
  os;
==>    ? `os` is undefined
==>    ? error occurred in or before ./examples/python_run.sing line 6: `  os\
   ;`
  attrib(os, "name");
==> 


Top Back: python_import Forward: countedref FastBack: pyobject operations FastForward: countedref Up: pyobject related functions Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 4.3.1, 2022, generated by texi2html.