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.
asked Oct 2, 2011 at 20:30
Zenvega
2,0649 gold badges31 silver badges48 bronze badges
2 Answers 2
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)
answered Oct 5, 2011 at 23:49
GreenMatt
18.6k9 gold badges56 silver badges82 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
You can use the os module:
import os
os.system('mybatchfile.bat')
or use the subprocess module
answered Oct 2, 2011 at 20:35
jle
9,5095 gold badges51 silver badges68 bronze badges
Comments
default