This commit is contained in:
Vitor Santos Costa
2018-02-26 21:38:19 +00:00
parent 530246688c
commit 3a36285bb2
12 changed files with 1767 additions and 1807 deletions

View File

@@ -20,7 +20,7 @@
%% ).
:- reexport(library(yapi)).
%:- reexport(library(yapi)).
:- use_module(library(lists)).
:- use_module(library(maplist)).
:- use_module(library(python)).
@@ -28,7 +28,8 @@
:- python_import(sys).
jupyter_query(Self, Cell, Line ) :-
setup_call_cleanup(
start_low_level_trace,
setup_call_cleanup(
enter_cell(Self),
jupyter_cell(Self, Cell, Line),
exit_cell(Self)
@@ -61,15 +62,15 @@ blankc('\n').
blankc('\t').
enter_cell(_Self) :-
open('//python/input', read, Input, []),
open('//python/sys.stdout', append, Output, []),
open('//python/sys.stdout', append, Error, []),
open('/python/input', read, Input, []),
open('/python/sys.stdout', append, Output, []),
open('/python/sys.stdout', append, Error, []),
set_prolog_flag(user_input, Input),
set_prolog_flag(user_output, Output),
set_prolog_flag(user_error, Error).
exit_cell(_Self) :-
%close( user_input),
close( user_input),
close( user_output),
close( user_error).