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
精彩评论