I fiddled around with calling a python script from a Java program for a little while and was finally able to get it working. However, When I called it I noticed that there is a certain call in the python script that creates an object that takes a couple of seconds (which is longer than I'd like). So in an essence every time the script runs it has to re-import a few libraries and create a new object. I'm not sure if this is even possible, but is there any way to keep the python script in a state where it wouldn't have to completely re-run from the start every single time?
Any help would be greatly appreciated. I do not have much experience with the integration of programs with different languages.
Thank you very much!!! Any suggestions are welcome.
I'm not sure if this is even possible, but is there any way to keep the python script in a state where it wouldn't have to completely re-run from the start every single time?

The correct and most obvious way to do this is to re-implement (if you can) the Python script and turn it into some kind of Remote Serivce and use some kind of Interface:
Examples:

Web Service over JSON
Web Service over RPC, JSON-RPC, XML-RPC

You would then access the service(s) remotely over a network connection from your Java program and serialize parameters passed to the Python program and theh results back to Java via something both can speak eaisly. e.g: JSON
Integration between a Python script and Java program