Hello everybody,
so I played with erlport and it works well for me on a module base (calling functions).
I tried to instanciate a custom python class to get an object, but I cannot call any methods on this object later.
I am not sure, if a completely understand how erlport works in the background, so maybe it not possible to “hold” the instance in erlang and later call methods on this instance.
Does anybody know if this should work with erlport? Some hint would be welcome.
[EDIT]
Basically what I do is this:
Python:
class Pyclass:
def __init__(self):
print("pyClass __init__")
self.value = 3
def get_value(self):
return self.value
Erlang:
{ok, Python} = python:start_link([{python_path, "/path/"}, {python, "python3"}]),
{'$erlport.opaque', python, Object} = python:call(Python, pyclass, 'Pyclass', []),
python:call(Python, pyclass, 'Pyclass.get_value', [Object]).
what I get when running the code:
"'bytes' object has no attribute 'value'"
so self does not represent my python object, that’s for sure
Thanks, alex