Reputation: 2051
I have a Python program status.py
that prints some status updates (strings) to the console. However, I need to write a JavaFX program Display.java
that launches the Python program and then prints the Python program's status updates to a TextArea
.
To accomplish this I've altered status.py
to write its status updates to a text file and then have the Java program read the text file into the TextArea
.
The text file method is working, but I feel like there is a better way to communicate. I am thinking about having the Python program write its status updates to a socket and having the Java program listen to the socket using ServerSocket
.
Is using a networking approach such as communicating through sockets the best way to accomplish communication between status.py
and Display.java
? If not, what is the best way to accomplish such inter-proccess communication?
Upvotes: 3
Views: 3177
Reputation: 2051
There are two options for communicating information from a Python process to a Java process:
Upvotes: 1