Problem calling foamDictionary in docker from a python notebook
Dear Foamers,
I am trying to use the docker image under Windows (1912) and preparing a Jupyter notebook to manage the work. I issue docker commands using subprocesses because I did not have any luck with their Python SDK. Now I am getting familiar with foamDictionary by calling its commands from the notebook. It seems to work except for a special case where I get an error that I cannot decipher. A Docker command that works from the notebook: Code:
subprocess.run(docker exec containerName sh -c "\"source /opt/OpenFOAM/setImage_v1912.sh; cd case; foamDictionary system/controlDict -entry endTime -set 100\"") Code:
subprocess.run(docker exec containerName sh -c "\"source /opt/OpenFOAM/setImage_v1912.sh; cd case; foamDictionary 0/U -entry internalField -set \"uniform (0 0 0 )\"\"") Code:
/opt/OpenFOAM/OpenFOAM-v1912/etc/config.sh/functions: eval: line 67: syntax error near unexpected token `)' A clue could be in how Python issues the command to docker which most likely looks like: Code:
"source /opt/OpenFOAM/setImage_v1912.sh; cd case; foamDictionary 0/U -entry internalField -set "uniform (0 0 0 )"" I appreciate helpful pointers and grateful for a solution! Best regards, Hisham |
All times are GMT -4. The time now is 09:37. |