Reputation: 63
I'm trying to use a jar file in python using the library os
.
I succeeded to run the jar file without a problem using the function os.system()
my command was like this:
cmd = "java -jar ./scripts/my_jar/users.jar"
os.system(cmd)
I would like to ask:
Upvotes: 0
Views: 297
Reputation: 588
You shouldn't need to kill the jar file independently of the python program, at least with os.system. After the python program is terminated (you stop the process forcefully) the jar file will also terminate. Note, however, that if you prematurely kill/stop the python file, the jar will be forced to terminate without returning an output.
Upvotes: 1