1

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)
1
  • How do you run test.py with Jython from the command-line? Does it succeed? Commented Jun 23, 2014 at 8:41

1 Answer 1

2

There are two possible problems here:

  • change Jython to jython as the terminal/python are case sensitive.
  • specify the absolute path to your test script '/{PATH TO TEST SCRPIT}/test.py'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.