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
<ahref="javascript:alert('Return value from PyTest1: '+PyTest1(100))">window.PyTest1(100)</a><br>
42
-
<ahref="javascript:alert('Return value from PyTest2: '+PyTest2(100, 'This string was passed from javascript'))">window.PyTest2(100, 'This string was passed from javascript')</a>
39
+
See output in console for these tests. (Note: "window." is optional, you can just call "PyTest1()")<br><br>
40
+
41
+
<ahref="javascript:alert('Return value from PyTest1: '+PyTest1(100))">window.PyTest1(100)</a><br>
42
+
<ahref="javascript:alert('Return value from PyTest2: '+JSON.stringify(PyTest2(100, 'This string was passed from javascript')))">window.PyTest2(100, 'This string was passed from javascript')</a> - python PyTest2() should return: [1,2, [2.1, {'3': 3, '4': [5,6]}]]
43
+
<br><br>
44
+
45
+
<script>vararray=[1];array[100]=100.01;</script>
46
+
<ahref="javascript:PyTest1(array)">window.PyTest1(array)</a> (var array = [1]; array[100] = 100.01;) - the gap is filled with None values.<br>
<ahref="javascript:PyTest1(nested)">window.PyTest1(nested)</a> (var nested = [1,2, [3, 4, [5,6, [{7:7, 8: [9,10]}, 11]]]];) - dictionary keys will be in a different order in Python.<br>
Try setting PyConfig during runtime using __browser.GetMainFrame().SetProperty(): <ahref="javascript:ChangePyConfig()">ChangePyConfig()</a> (then call PrintPyConfig())
62
+
63
+
<br><br>
64
+
Test infinite recursion: <ahref="javascript:PyTest1(window)">PyTest1(window)</a> - you will see a python exception in console (also in error.log), data structures can have maximum 10 levels of nesting.
0 commit comments