开发者

how can we run python script(which uses nltk and scrapy) from java

I have written python scripts that use scrapy,nltk and simplejson in my project but i need to run them from java as my mentor wants to deploy them on a server and i have very less time to do this.I took a glance at runtime.exec() in java and jython, needless to say that running system commands from java doesn't look simple either.

So I would like to know if running the python scripts from java as system command -'python example.py ' using runtime.exec() or alternatively using jython would be more simpler and actually feasible or whether there is a simpler workaround .It would also be great to know if anyone had run python code that uses nltk from java using Jython and whether they encountered any proble开发者_JS百科ms.Please help me as I have to do this as asap.Any thoughts and suggestions regarding this are welcome.

Thanking in advance!!


The Jepp project lets you call python scripts from Java. It provides an easy mechanism to pass variables into a script and extract values back. I've used on a few projects with good success

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜