Python: How can I execute a jar file through a python script

前端 未结 5 900
别跟我提以往
别跟我提以往 2020-11-27 15:04

I have been looking for an answer for how to execute a java jar file through python and after looking at:

Execute .jar from Python

How can I get my python (v

5条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 16:00

    How about using os.system() like:

    os.system('java -jar blabla...')
    

    os.system(command) Execute the command (a string) in a subshell. This is implemented by calling the Standard C function system(), and has the same limitations. Changes to sys.stdin, etc. are not reflected in the environment of the executed command.

提交回复
热议问题