0

I have a Java script - with a function that I wrote, that I send her a list of strings, the function encrypt each element, and returns a list with the encrypted elements.

My problem is this: I need to use this function in a python script (send a "list" Python object as input, and receive an "ArrayList" Java object).

How can I call a Java function - that I wrote, in a python script?

And does the list objects are consistent between Python and Java (list Vs. ArrayList)?

A big thank you to all!

** Edit: I'm about to use this entire package in AWS Lambda Function **

Bramat
  • 979
  • 4
  • 24
  • 40

1 Answers1

0

The main decisions for choosing a solution seem to be

  • What do we use to execute the Java program?
  • How do we transfer computed data from the Java program to the Python program?

E.g. you could decide to use a Java JVM and execute via a call to the operating system from Python.

The computed data could be sent to standard output (in some suitable format) and read in and processed by Python. (See link for the os call and i/o)

Community
  • 1
  • 1
mvw
  • 5,075
  • 1
  • 28
  • 34