Python insert in Vala

I want to embed a Python interpreter in a program written in Vala to allow some execution scripts. I can run parts of my vala code with Python using Introspection, and I found a rudimentary example of implementing an interpreter in Python here: https://gist.github.com/astagi/1282808 .

This example does not show how to pass an instance of an object in Vala to the interpreter and vice versa. In the example of how to embed Python ( http://docs.python.org/3/extending/embedding.html#pure-embedding , a variable of type long is converted to / form type python using something like this

PyObject *pvalue = PyLong_FromLong(foo); 

and

 long foo=PyLong_asLong(pvalue); 

The question is, what are the equivalent functions for a variable in Vala of type GLib.Object [GObject in form C].

+4
source share

Source: https://habr.com/ru/post/1483271/


All Articles