external binary reading standard in

Markus O Kaukonen markus.kaukonen at iki.fi
Fri Aug 2 15:18:18 CEST 2002

Dear All,

Sorry for my question above.
os.popen and
os.system both work fine.

We just had some very old/badly installed python here in local machines.

Thank's for all answers anyway!

So the following now works

#!/usr/bin/env python
import os
os.popen( "write-mm-data <allatoms.data " )


#!/usr/bin/env python
import os
os.system( "write-mm-data <allatoms.data " )


Markus O Kaukonen wrote:

> Dear all,
> How to execute a external (binary) program  reading from standard input
> in a python code ?
> For example :  /home/mok/my_prog.bin < my_input.txt
> My system is Linux and the binary is written originally in fortran 90
> (if that should matter).
> I tried
> os.popen('/home/mok/my_prog.bin < my_input.txt ')
> with no success
> Best Wishes,
> Markus Kaukonen, Finnland

More information about the Python-list mailing list