-3

I basically want to write a python code, from where I send an input string to jave program, I want the java program to execute it and return the result to the python file. Is it possible?

User5421
  • 1
  • 2

1 Answers1

-1

You can create a java program which reads the value/string passed from command line, processes it and write it in System.out or System.err. Similarly, In python, use subprocess module to invoke java program and passing string as command line argument. Thereafter perform PIPE based IO to receive the output written to System.out and System.err by java program.

I am not writing the code, as you haven't shown any code/effort from your side to solve the problem. I am just giving you a hint, regarding how to solve the problem.

Mangu Singh Rajpurohit
  • 10,806
  • 4
  • 68
  • 97