'How do I execute a python script from Java Spring Boot web application controller on AWS?

So, I'm new to spring boot applications AND new to AWS. Can anyone suggest steps on how to make this happen?

I assume I need to install python somewhere in AWS? As well as tweak my code to execute (pasted below) but have no idea what directory it would sit in...

            try {
                //Execute Python command through exec() function Py script, return stored procedure
                proc = Runtime.getRuntime().exec("python C:\\Users\\SomeUserName\\getReport1.py");
                
                BufferedReader in = new BufferedReader(new 
                InputStreamReader(proc.getInputStream()));
                //Building row data objects
                
                String line = null;
                //Read and print results line by line
                while ((line = in.readLine()) != null) {
                    System.out.println(line);
                }
                
                
                in.close();
                proc.waitFor();
                
            } catch (IOException e) {


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source