Creating python as system calls in java

Is there an equivalent of Python popen2 in Java?

+3
source share
2 answers

I believe that an object Processis what you are looking for. Javadoc is here . You use it in some way. Process myProcess = System.getRuntime().exec("cmd here"));It allows you to receive standard and output streams.

+4
source

System.getRuntime().exec(...)

System.getRuntime()gives a runtime object from which you can create various calls .exec(...)that spawn the object Process. It has input and output streams and status.

+3
source

Source: https://habr.com/ru/post/1759537/


All Articles