is their any limit on the size of the data passed to a program via popen2?

husam h.jehadalwan at
Fri Feb 22 18:56:01 CET 2002

hi, I'm trying to pass files to a program ( a biochemistry program 
called "profit") for processing via popen2. I have 10000 files with 
total size of 1500 Mb. The files have to be passed to the program one by 
one. Each file represents a molecule, which has to be compared to a 
reference molecule. The code works only for ~200 files and fails when I 
pass all the files. What should I do?

The code:

  pdbdir = os.popen('ls /home/data/pdbs') # if this directory contains 
10000 files, the code does not work.

(o,i) = popen2.popen2("/home/programs/profit ")

i.write("reference /usr/local/3D_Dock/progs/Complex_1g.pdb ") # This the 
reference molecule.

for PDB in files:
     i.write(" mobile /home/data/pdbs/" + PDB + "\n") # A new molecule.
     i.write("fit\n")		# compares reference and new molecules.


Thanks in advance.

More information about the Python-list mailing list