0

I would need some interprocess communication via stdin and stdout between a python script and a java engine.

Is there anyway I could convert a python object into JSON and converting this whole object as a string to be passed via stdin to Java and converting that string back to JSON for processing before returning it back to python as a JSON object converted via a string

In Summary this is what I need

Python Object-> JSON -> String -> Stdin -> String -> JSON in java ->processing -> JSON -> String -> Stdout -> python -> String -> JSON

Any other solutions that satisfy this condition is also acceptable.

I would just like to know if its possible to send a JSON object via stdin or what are the possible ways to do it

3
  • 1
    Pure code-writing requests are off-topic on Stack Overflow -- we expect questions here to relate to specific programming problems -- but we will happily help you write it yourself! Tell us what you've tried, and where you are stuck. This will also help us answer your question better. Commented Sep 2, 2015 at 3:38
  • @ElliottFrisch I am not asking for any codes. I just would like to know if its possible or is it possible to do it this way Commented Sep 2, 2015 at 3:42
  • Frankly, this reads like a code request to me as well. You should probably edit your question to properly indicate that you wish to know whether or not interprocess communication is possible between a python script and a java engine, via stdin and stdout. Commented Sep 2, 2015 at 3:48

1 Answer 1

2

Here is how you would convert a Python object to JSON, here is an article showing how to use JSR 353 to parse JSON, and consider using sockets for IPC.

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.