The first issue concerns a Flask container that is available inside a Docker Compose environment. The goal is to make the Flask container able to communicate with the localhost command line in order to send requests and retrieve responses. Specifically, we are using Python’s os.popen method to send parameters to the C# code, execute it, and then retrieve the response. An example of this can be found below:
pi_system_data=os.popen(f"C:\Users\NVTC\source\repos\TagValues4\bin\Debug\TagValues.exe “{str_pi}” “{mindate}” “{maxdate}” “{period}” ")
pi_system_data= pi_system_data.read()
As we are planning to move this project to a Docker Compose environment, we need to find a way for the Python script to still be able to interact with the localhost command line in order to execute the C# code.
The second issue is related to certain packages that I am using in the project. Specifically, I am having trouble with the pynput package, which is mainly used to mimic keyboard clicks in the system. The package works fine when running in Windows, but when I move it to the Docker Compose environment, I am encountering some issues. Kindly find below the package code that is causing the issue:
from pynput import keyboard as keyb
When I comment out the import code and other related code for this package, the system works fine. However, when the pynput package is included, I am encountering the error as shown in the screenshot attached.
image.png
I would greatly appreciate any guidance or suggestions you may have on how to resolve these issues. Please let me know if you need any additional information or if there is anything else I can provide to assist in resolving these issues.