AA computes a function using a software called CasADi. I have installed CasADi, and AA can run on my desktop.
BB has to run in a container and imports data from AA.Because of this, BB cannot run because it doesn't recognize CasADi
How can I change the import statement in file BB to extract data from AA, which is in a different location. Both AA and BB are python files
I have tried the following import statements. Both did not work.
from AA import c_A
from home.user.Desktop.AA import c_A
As long as you have a way to copy files into the container, it's not too hard. In your AA script, you can do:
Now, you would have to take a manual to copy the file into the container. Once in the container, in your BB script, you can do:
and that will work.
If you don't have a way to copy files, then you would have to use a TCP client/server thing. That takes more coordination, because one side has to be a server, which runs FIRST and sits and waits for the other side to check in. After they're connected, you can use
np.saveto save the file to aio.BytesIOobject, which acts just like a file, then send the contents over the socket. There are many examples on the web of simple TCP socket exchanges in Python.