From: Gökhan S. <so...@it...> - 2017-03-27 09:03:23
|
Hello, I want to run a python process from my prolog script (YAP-6.2.2) and read its output formatted as a list of integers, e.g. [1,2,3,4,5,6]. This is what I do: :- use_module(library(process)). :- process_create(path(python3), ['my_script.py'], [stdout(pipe(Out))]), read(Out, OutputList), close(Out). However, it fails at read/2 predicate with the error: PL_unify_term: PL_int64 not supported Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'> BrokenPipeError: [Errno 32] Broken pipe I am sure that I can run the process correctly because with [stdout(std)] parameter given to process_create the program outputs [1,2,3,4,5,6] as expected. Weird thing is that when I change the process to output some constant_term it still gives the same PL_int64 error. Appending a dot to the process' output ([1,2,3,4,5,6].) doesn't solve the error. Using read_term/3 gives the same error. How can I solve this problem? This question is also asked here <http://stackoverflow.com/questions/43029488/read-a-list-from-stream-using-yap-prolog> . Thanks in advance, Gökhan Solak |