<dependency> <groupId>org.python</groupId> <artifactId>jython-standalone</artifactId> <version>2.7.0</version> </dependency>
@RestController
public class TestController {
@RequestMapping(value = "/startPython",method = RequestMethod.GET)
public void ExecPython()
{
System.out.println("----开始调用----");
PythonInterpreter pythonInterpreter = new PythonInterpreter();
pythonInterpreter.execfile("F:\\project\\python\\test.py");
}
}