Class PythonHelper
Provides a set of extension methods for working with Python.Runtime.PyObject instances.
public static class PythonHelper
- Inheritance
-
PythonHelper
- Inherited Members
Methods
ConvertPythonObjectToCSharp(PyObject)
Converts the specified Python object to a C# object.
public static object ConvertPythonObjectToCSharp(PyObject pyObject)
Parameters
pyObject
PyObjectThe Python object to convert.
Returns
- object
The C# object representation of the Python object.
GetArrayAttr(PyObject, string)
Gets the value of the specified array attribute from the Python object.
public static object GetArrayAttr(this PyObject pyObject, string attributeName)
Parameters
pyObject
PyObjectThe Python object.
attributeName
stringThe name of the attribute to retrieve.
Returns
- object
The array value of the specified attribute.
GetAttr<T>(PyObject, string)
Gets the value of the specified attribute from the Python object.
public static T GetAttr<T>(this PyObject pyObject, string attributeName)
Parameters
pyObject
PyObjectThe Python object.
attributeName
stringThe name of the attribute to retrieve.
Returns
- T
The value of the specified attribute.
Type Parameters
T
The type of the attribute to retrieve.