开发者

python: calling java program

I have a tag cloud generator that I would like to call from my python program. How can I do it?

I 开发者_C百科run it in a batch file

java -jar ibm-word-cloud.jar -C configure.txt input.txt output.png

thanks for your help.


The subprocess module is now preferred over os.system(). A simple example, assuming run_prog.bat contains the command you need:

import subprocess
cmd = "run_prog.bat"
proc = subprocess.Popen(cmd)


You can use the os module:

import os
os.system('mybatchfile.bat')

or use the subprocess module

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜