Merge branch 'master' of https://github.com/vscosta/yap-6.3
This commit is contained in:
12
packages/python/examples/plot.yap
Normal file
12
packages/python/examples/plot.yap
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
:- [library(python)].
|
||||
|
||||
main :-
|
||||
Plt = matplotlib.pyplot,
|
||||
:= import( Plt ),
|
||||
:= (
|
||||
Plt.plot([1,2,3,4]),
|
||||
Plt.ylabel(`some numbers`),
|
||||
Plt.show()
|
||||
).
|
||||
|
@@ -634,7 +634,7 @@ static int python_import(term_t mname, term_t mod) {
|
||||
s = stpcpy(s, sa);
|
||||
*s++ = '.';
|
||||
} else if (!PL_get_nchars(mname, &len, &s,
|
||||
CVT_ALL | CVT_EXCEPTION | ENC_ISO_UTF8)) {
|
||||
CVT_ALL | CVT_EXCEPTION | REP_UTF8)) {
|
||||
return false;
|
||||
} else {
|
||||
break;
|
||||
|
@@ -110,7 +110,10 @@ Data types are
|
||||
:- use_module(library(charsio)).
|
||||
:- dynamic python_mref_cache/2, python_obj_cache/2.
|
||||
|
||||
:= import( F ) :- python_import(F).
|
||||
:= (P1,P2) :- !,
|
||||
:= P1,
|
||||
:= P2.
|
||||
:= import( F ) :- !, python_import(F).
|
||||
:= F :- python(F,_).
|
||||
|
||||
V := F :- var(V), !, python(F,V0),
|
||||
|
Reference in New Issue
Block a user