You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Place [callout DLL/SO/DYLIB](https://github.com/intersystems-ru/PythonAdapter/releases) in the `bin` folder of your InterSystems IRIS installation. Library file should be placed into a path returned by `write ##class(isc.py.Callout).GetLib()`.
4. Place [callout DLL/SO/DYLIB](https://github.com/intersystems-ru/PythonAdapter/releases) in the `bin` folder of your InterSystems IRIS installation. Library file should be placed into a path returned by `write ##class(isc.py.Callout).GetLib()`.
9
10
10
11
## Windows
11
12
12
-
3. Check that your `PYTHONHOME` environment variable points to Python 3.6.7.
13
-
4. Check that your SYSTEM `PATH` environment variable has `PYTHONHOME` variable (or directory it points to).
13
+
5. Check that your `PYTHONHOME` environment variable points to Python 3.6.7.
14
+
6. Check that your SYSTEM `PATH` environment variable has `PYTHONHOME` variable (or directory it points to).
14
15
15
-
## Linux && Mac
16
+
## Linux
16
17
17
-
3. Check that your SYSTEM `PATH` environment variable has `/usr/lib` and `/usr/lib/x86_64-linux-gnu`, preferably at the begining. Use `/etc/environment` file to set environment variables.
18
+
5. Check that your SYSTEM `PATH` environment variable has `/usr/lib` and `/usr/lib/x86_64-linux-gnu`, preferably at the begining. Use `/etc/environment` file to set environment variables.
19
+
6. In cause of errors check Troubleshooting section `undefined symbol: _Py_TrueStruct` and specify PythonLib property.
20
+
21
+
## Mac
22
+
23
+
5. Only python 3.6.7 from [Python.org](https://www.python.org/downloads/release/python-367/). is currently supported. Check `PATH` variable.
18
24
19
25
If you modified environment variables restart your InterSystems product.
20
26
21
27
## Docker
22
28
23
29
1. To build docker image:
24
30
- Copy `iscpython.so` into repository root (if it's not there)
3. Test process `isc.py.test.Process` saves image aftifact into temp directory. You might want to change that path to a monted directory. To do that edit annotation for `Correlation Matrix: Graph` call, specifying valid filepath for `f.savefig` function.
37
43
4. For terminal access execute: `docker exec -it irispy sh`.
38
-
5. Access SMP with SuperUser/SYS or Admin/SYS users.
44
+
5. Access SMP with SuperUser/SYS or Admin/SYS user/passowrd.
1. Call: `set sc = ##class(isc.py.Callout).Setup()` once per systems start (add to ZSTART: [docs](https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GSTU_customize#GSTU_customize_startstop), [sample](https://gist.githubusercontent.com/eduard93/412ed81e2bf619269ab4a49d939d2304/raw/c9d5f922827db5052b6e1195616d333ffe7dc1ec/%2525ZSTART)).
49
+
1. Call: `set sc = ##class(isc.py.Callout).Setup()` once per systems start (add to ZSTART: [docs](https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GSTU_customize#GSTU_customize_startstop), sample routine available in `rtn` folder).
44
50
2. Call main method (can be called many times, context persists): `write ##class(isc.py.Main).SimpleString(code, variable, , .result)`
45
51
3. Call: `set sc = ##class(isc.py.Callout).Finalize()` to free Python context.
46
52
4. Call: `set sc = ##class(isc.py.Callout).Unload()` to free callout library.
@@ -58,13 +64,16 @@ Generally the main interface to Python is `isc.py.Main`. It offers these methods
58
64
-`SimpleString(code, returnVariable, serialization, .result)` - for cases where both code and variable are strings.
59
65
-`ExecuteCode(code, variable)` - execute `code` (it may be a stream or string), optionally ser result into `variable`.
60
66
-`GetVariable(variable, serialization, .stream, useString)` - get `serialization` of `variable` in `stream`. If `useString` is 1 and variable serialization can fit into string then string is returned instead of the stream.
61
-
-`GetVariableInfo(variable, serialization, .defined, .type, .length)` - get info about variable: is it defined, type,and serialization length.
67
+
-`GetVariableInfo(variable, serialization, .defined, .type, .length)` - get info about variable: is it defined, type,and serialization length.
62
68
-`GetStatus()` - returns last occured exception in Python and clears it.
63
69
-`GetVariableJson(variable, .stream, useString)` - get JSON serialization of variable.
64
70
-`GetVariablePickle(variable, .stream, useString)` - get Pickle serialization of variable.
65
71
-`ExecuteQuery(query, variable, type)` - create resultset (pandas `dataframe` or `list`) from sql query and set it into `variable`.
66
72
-`ImportModule(module, .imported, .alias)` - import module with alias.
67
73
-`GetModuleInfo(module, .imported, .alias)` - get module alias and is it currently imported.
74
+
-`GetFunctionInfo(function, .defined, .type, .docs, .signature, .arguments)` - get function information.
75
+
-`ExecuteFunction(function, positionalArguments, keywordArguments, variable, serialization, .result)` - execute Python function or method, write result into Pyhton `variable`, return chosen serialization in `result`.
76
+
-`ExecuteFunctionArgs(function, variable, serialization, .result, args...)` - execute Python function or method, write result into Pyhton `variable`, return chosen serialization in `result`. Builds `positionalArguments` and `keywordArguments` and passes them to `ExecuteFunction`. It's recommended to use `ExecuteFunction`. More information in [Gateway docs](Gateway.md).
68
77
69
78
Possible Serializations:
70
79
-`##class(isc.py.Callout).SerializationStr` - Serialization by str() function
@@ -123,7 +132,7 @@ set sc = ##class(%UnitTest.Manager).RunTest(,"/nodelete")
123
132
124
133
# ZLANGC00
125
134
126
-
Install [this ZLANG routine](https://gist.githubusercontent.com/eduard93/2c3159c7dc71f03c4081a99093d8ff37/raw/3bc83f2dc7348ea11ab982b0e3d54cfcef198d17/%2525ZLANGC00.xml) to add `zpy` command:
135
+
Install ZLANG routine from `rtn` folder to add `zpy` command:
0 commit comments