Reputation: 45
I am new to both Python and Jython. I am just wondering if is possible to use Python to execute a Jython script and get its result.
The reason is the code was previously done by another person and I do not want to go changing or messing with every single thing that has compatibility issue with Jython. because I just need to pass some data to a Java class and receive its return result.
I try using subprocess but i kept getting a error stating (The system cannot find the file specified)
from subprocess import Popen, PIPE, STDOUT
p = Popen(['Jython', 'test.py'], stdin=PIPE, stdout=PIPE, stderr=STDOUT)
Upvotes: 1
Views: 404
Reputation: 2015
There are two possible problems here:
Jython
to jython
as the terminal/python are case sensitive.'/{PATH TO TEST SCRPIT}/test.py'
Upvotes: 2