How to execute an external binary reading from standard in

Mark McEahern marklists at mceahern.com
Tue Jul 30 11:01:02 EDT 2002


> How to execute a exeternal (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

Have you looked at popen's cousins?  popen2, 3, 4, etc?

Cheers,

// mark
-





More information about the Python-list mailing list