Java and Python - System.console() returns null when started from subprocess -


I am trying to start a Java file in a subprocess in Python. The problem is that System.console () returns zero in Java, though I am redirecting the STD stream.

  server_startcmd = ["java", "-xmx% s"% self.java_heapmax, "-xms% s"% self.java_heapmin, "-jar", self.server_jar, self. Java_gui,] self.server = Popen (server_startcmd, stdout = PIPE, stderr = PIPE, stdin = PIPE) self.outputs = [Self.server_socket, self.server.stderr, self.server.stdout, sys.stdin]   

When I run the Java command from the command line, it works fine.

I really can not understand what I can do to simulate a console or something like that?

Finally, I use pty to pseudoterminal.

This time in Ruby:

  is required 'pty' @master_io, slave = PTY.open read, @write_pipe = IO.pipe pid = spawn (server_startcmd) ,: <= Code>  

However thanks for the help!

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -