I want to know what is the easiest way to pass a String from my Java program to my Python program. The reason is that I use boilerpipe to extract some text from the web, then analyse it through my Java program, but I also have to make some semantic searchs using pattern.en, which is only available for python.
I don't need to get results back from my python program, just that my Python program can get the String.
I first thought about letting my python program listen to a .txt file, while java feeds it with the String, but I think it'll be too hard to make.
I'm on Windows 7, and my Python version is 2.7.9.
EDIT : I think I haven't been very clear actually. Ideally, I'd want my java code to run my python program which would have recieved the string.
Graciela Runolfsdottir's 2nd answer would maybe do the trick, if I can make something like that :
String s = "string to analyse"
FileUtils.writeStringToFile(new File("test.txt"), s);
Then execute it with : python analyzer.py test.txt
, but I don't know how to call this command from java. Is it possible ?