Reputation: 2054
I have a tag cloud generator that I would like to call from my python program. How can I do it?
I run it in a batch file
java -jar ibm-word-cloud.jar -C configure.txt input.txt output.png
thanks for your help.
Upvotes: 2
Views: 1731
Reputation: 18570
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)
Upvotes: 3
Reputation: 9479
You can use the os module:
import os
os.system('mybatchfile.bat')
or use the subprocess module
Upvotes: 2