I have an executable (named "prova"), that has two inputs and run via single bash command line:
./prova ../MW1/atmf370r10a Ctes370r10a
Then the first input is a path to a file I need to read and the second is one to be created. This executable has to be run over a lot of files, so a loop is needed.
My python script reads a list of files named "filename" and runs a loop:
with open(filename) as f:
for line in f:
AtmFileName=line.split(None, 1)
if (is_number(AtmFileName[0])==False):
MassFileName=AtmFileName[1]
AtmFileName= AtmFileName[0]
bashCommand="./prova ../MW1/"+AtmFileName+" C"+MassFileName
print "bash command is: "+ bashCommand
os.system(bashCommand)
if 'str' in line:
break
It runs. The files are created. But, they are appended by ?
at the end of the name. I can see the marks only if I type ls
. Those files can't be opened.
If I run just one line by manually copying one of printed lines ("bash command is: " ) it works and the files are not appended by ?
and they can be opened.
What can be the problem?