4 > executePythonStatement "foo = 'bar'\nd = dir()"
\r
5 > getPythonStringArrayVariable "d"
\r
6 vector ["__builtins__", "__doc__", "__loader__", "__name__", "__package__", "__spec__", "foo"]
\r
8 > setPythonDoubleVariable "foo" 1
\r
9 > executePythonStatement "foo = foo + 1"
\r
10 > getPythonDoubleVariable "foo"
\r
13 > setPythonDoubleArrayVariable "foo" (vector [1.0, 2.0, 3.0])
\r
14 > executePythonStatement "foo = foo + [4.0]"
\r
15 > getPythonDoubleArrayVariable "foo"
\r
16 vector [1.0, 2.0, 3.0, 4.0]
\r
18 > setPythonIntegerVariable "foo" 5
\r
19 > executePythonStatement "import math"
\r
20 > executePythonStatement "bar = math.factorial(foo)"
\r
21 > getPythonIntegerVariable "bar"
\r
24 > setPythonIntegerArrayVariable "foo" (vector [1, 2, 3, 4])
\r
25 > executePythonStatement "foo.append(sum(foo))"
\r
26 > getPythonIntegerArrayVariable "foo"
\r
27 vector [1, 2, 3, 4, 10]
\r
28 > ndarray (vector [1, 2, 3])
\r
29 ndarray(3) [1.0, 2.0, 3.0]
\r
30 > ndarrayM 2 2 (vector [1, 2, 3, 4])
\r
31 ndarray(2x2) [[1.0, 2.0], [3.0, 4.0]]
\r
32 > a = ndarrayN (vector [2, 2, 3]) (vector [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
\r
34 ndarray(2x2x3) [[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]]
\r
38 vector [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0]
\r
39 > ndarrayElement a 5
\r
41 > ndarrayElementN a (vector [0, 1, 2])
\r
44 > setPythonNDArrayVariable "foo" (ndarrayM 2 3 (vector [1, 2, 3, 4, 5, 6]))
\r
45 > executePythonStatement "bar = foo.cumsum(1)"
\r
46 > getPythonNDArrayVariable "bar"
\r
47 ndarray(2x3) [[1.0, 3.0, 6.0], [4.0, 9.0, 15.0]]
\r
49 > setPythonVariable "foo" ([1.0, 2.0, 3.0, 4.0] :: [Double])
\r
50 > executePythonStatement "foo.append(sum(foo))"
\r
51 > getPythonVariable "foo" :: [Double]
\r
52 [1.0, 2.0, 3.0, 4.0, 10.0]
\r