How to get the output from .jar execution in python codes?

前端 未结 3 385
一个人的身影
一个人的身影 2020-12-29 12:46

I\'m programming the python module that executes SQL to DBMS and retrieves data. I\'m trying to use jdbc jar files instead of native DB drivers. I\'m wondering how to execut

3条回答
  •  灰色年华
    2020-12-29 13:10

    If you are using Linux you can use the os.system command:

    os.system("your_java_file > out_put_file")
    

    This command will execute the file and print the output to the out_out_file Then you can read the output file.

提交回复
热议问题