Skip to content

Commit 146487b

Browse files
authored
Add script myPy4j.py
1 parent 48ca1e7 commit 146487b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

gestures/myPy4j.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)