@TestpublicvoidoneList(){List<Double> list =newArrayList<>();
list.add(1.222);
list.add(2.888);
list.add(3.888);
list.add(4.888);
list.add(5.888);String flag =oneList(list);System.out.println(flag);}
publicStringoneList(List<Double> list){String result =null;try{// String python = "/usr/local/bin/python3.10"; // pythonString python ="python";String file ="/app/hello_list01_arg.py";Process process =Runtime.getRuntime().exec(python +" "+ file +" "+ list);// 执行py文件BufferedReader in =newBufferedReader(newInputStreamReader(process.getInputStream()));String line;while((line = in.readLine())!=null){
result = line;}
in.close();
process.waitFor();}catch(IOException e){
e.printStackTrace();}catch(InterruptedException e){
e.printStackTrace();}return result;}