Function call problem
kaccoon opened this issue · 3 comments
Hi pravic, I encounter a problem when calling python from tiscript. I pass a array as parameter in tiscript, but it raise a type error.
My code juse like:
view.some_function([1, 2, 3]);
and error message:
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 234, in 'calling callback function'
File "C:\Users\admin\AppData\Local\Programs\Python\Python35-32\lib\site-packages\sciter\event.py", line 215, in _element_proc
return self._on_script_call(p.contents)
File "C:\Users\admin\AppData\Local\Programs\Python\Python35-32\lib\site-packages\sciter\event.py", line 152, in _on_script_call
args = sciter.Value.unpack_from(f.argv, f.argc)
File "C:\Users\admin\AppData\Local\Programs\Python\Python35-32\lib\site-packages\sciter\value.py", line 570, in unpack_from
return [value(args[i]).get_value() for i in range(count)]
File "C:\Users\admin\AppData\Local\Programs\Python\Python35-32\lib\site-packages\sciter\value.py", line 570, in
return [value(args[i]).get_value() for i in range(count)]
File "C:\Users\admin\AppData\Local\Programs\Python\Python35-32\lib\site-packages\sciter\value.py", line 462, in get_value
raise TypeError(str(t) + " is unsupported python type")
TypeError: VALUE_TYPE.T_OBJECT is unsupported python type
I want to know is there anything wrong with my code? Or pysciter not support use array as parameter?
Python version: 3.5.2, pysciter version: 0.4.4 and use sciter-sdk-3.
Here is an answer: http://sciter.com/forums/topic/c-array-to-script/#post-45121.
So use value.isolate to detach value from sciter VM instance and convert it to JSON type.
I think, I can do it on the fly.. But I am not sure.
Thanks, that's what I need.