|  |  4.27.4 pyobject related functions 
 
attriblist, get and set attributes (class members) of a pyobject (see  attrib)
Example:
 |  |   pyobject pystr = "Kublai Khan";
  // Additional functionality through attrib
  attrib(pystr, "__doc__");
==> "str(object='') -> string\n\nReturn a nice string representation of the o\
   bject.\nIf the argument is a string, the return value is the same object.\
   "
  proc(attrib(pystr, "count"))("K");
==> 2
  pystr."__doc__";           // <- Short notations
==> "str(object='') -> string\n\nReturn a nice string representation of the o\
   bject.\nIf the argument is a string, the return value is the same object.\
   "
  pystr.count("a");          // Even shorter (if attribute's name is valid and unused)
==> 2
  python_run("def func(): return 17");
  attrib(func);
==> ['__call__', '__class__', '__closure__', '__code__', '__defaults__', '__d\
   elattr__', '__dict__', '__doc__', '__format__', '__get__', '__getattribut\
   e__', '__globals__', '__hash__', '__init__', '__module__', '__name__', '_\
   _new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__siz\
   eof__', '__str__', '__subclasshook__', 'func_closure', 'func_code', 'func\
   _defaults', 'func_dict', 'func_doc', 'func_globals', 'func_name']
  attrib(func, "func_name");
==> 'func'
  attrib(func, "func_name", "byAnyOtherName");
  attrib(func, "func_name");
==> 'byAnyOtherName'
 | 
 
killattribdeletes an attribute from a pyobject (see  killattrib)
Example:
 |  | LIB("pyobject.so");
python_run("def new_pyobj(): pass");
attrib(new_pyobj, "new_attr", "something");
attrib(new_pyobj, "new_attr");
==> 'something'
attrib(new_pyobj);
==> ['__call__', '__class__', '__closure__', '__code__', '__defaults__', '__d\
   elattr__', '__dict__', '__doc__', '__format__', '__get__', '__getattribut\
   e__', '__globals__', '__hash__', '__init__', '__module__', '__name__', '_\
   _new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__siz\
   eof__', '__str__', '__subclasshook__', 'func_closure', 'func_code', 'func\
   _defaults', 'func_dict', 'func_doc', 'func_globals', 'func_name', 'new_at\
   tr']
killattrib(new_pyobj, "new_attr");
attrib(new_pyobj);
==> ['__call__', '__class__', '__closure__', '__code__', '__defaults__', '__d\
   elattr__', '__dict__', '__doc__', '__format__', '__get__', '__getattribut\
   e__', '__globals__', '__hash__', '__init__', '__module__', '__name__', '_\
   _new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__siz\
   eof__', '__str__', '__subclasshook__', 'func_closure', 'func_code', 'func\
   _defaults', 'func_dict', 'func_doc', 'func_globals', 'func_name']
 | 
 
python_runexecute string-given pythoncommands and import new symbols frompythonto SINGULAR's context (see  python_run).python_evalevaluate a string-given pythonexpression and return the result
to SINGULAR (see  python_eval).python_importimport pythonmodule into SINGULAR's context
(see  python_import) 
 |