We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48ca1e7 commit 146487bCopy full SHA for 146487b
gestures/myPy4j.py
@@ -0,0 +1,16 @@
1
+def myPy4j():
2
+ import os
3
+ import codecs
4
+ py4j = runtime.getService('i01.py4j')
5
+ ## Here we set the path to the desired script to be run by the py4j service
6
+ script = 'data/Py4j/i01.py4j/py4jTest.py'
7
+ if os.path.isfile(script):
8
+ f = codecs.open(script, 'r', 'utf-8')
9
+ try:
10
+ code = f.read()
11
+ finally:
12
+ f.close()
13
+ py4j.exec(code)
14
+ else:
15
+ print "Script not found:", script
16
+
0 commit comments