I have this python script: postpycess.py to draw data from a mesh file airfoil.p3d. This script was designed to work with input not using arguments, so I created an input file commands.txt and redirect it to the script.
commands.txt: (note that the first input which is the name of the airfoil should be provided without extension .p3d)
airfoil
1
1
q
q
In Windows I could run this as follows:
python postpycess.py < commands.txt
But Unfortunately, When I run that command on Ubuntu 20.04, the script fails:
The current working dir: /tmp/allworks/python/mwe
This is Postpycess, the CFD postprocessor
Version: 1.1
.p3dr project name: Error: can't read the file airfoil
However, the following works just file:
printf 'airfoil\n1\n1\nq\nq\n' | python postpycess.py
I've tried hard to narrow down the cause in the python script and create a minimal example that could reproduce the same issue without success.
Could you please, explain why redirecting the input from the file fails in Linux?
I appreciate your help.