]> gerrit.simantics Code Review - simantics/python.git/blobdiff - org.simantics.pythonlink/test/org/simantics/pythonlink/test/scripts/Python.sts
Some changes to Python.scl.
[simantics/python.git] / org.simantics.pythonlink / test / org / simantics / pythonlink / test / scripts / Python.sts
index 7464d73ceae34d742dd269620c2bd230ef6b67cd..50c0423ab0763d465e15c965070179d3773221b0 100644 (file)
@@ -1,5 +1,4 @@
-> import "Simantics/Python"\r
-> import "Vector"\r
+> import "Python"\r
 > \r
 > runPython do\r
 >     executePythonStatement "foo = 'bar'\nd = dir()"\r
@@ -46,3 +45,8 @@ 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]
 >     executePythonStatement "bar = foo.cumsum(1)"\r
 >     getPythonNDArrayVariable "bar"\r
 ndarray(2x3) [[1.0, 3.0, 6.0], [4.0, 9.0, 15.0]]\r
+> runPython do\r
+>     setPythonVariable "foo" ([1.0, 2.0, 3.0, 4.0] :: [Double])\r
+>     executePythonStatement "foo.append(sum(foo))"\r
+>     getPythonVariable "foo" :: [Double]\r
+[1.0, 2.0, 3.0, 4.0, 10.0]\r