ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/smi23d/src/mengine/mengine.py
Revision: 17
Committed: Mon Jun 23 21:33:34 2008 UTC (11 years, 9 months ago) by tjod
File size: 585 byte(s)
Log Message:
Change to popen3 to be able to capture stderr

Line File contents
1 import os
2
3 molblock_in = file("drugs.sdf").read()
4 cmd = os.curdir + os.sep + "mengine -dxi"
5 # mengine will read multi-molblock sdf files,
6 # but calling through popen2 with some (large?) files hangs on windows,
7 # even though the same file runs fine at command line.
8 # So, split into separate files.
9 for molblock_in in (file("drugs.sdf").read()).split('$$$$\n'):
10 if len(molblock_in) > 0:
11 mengine_in, mengine_out, mengine_err = os.popen3(cmd)
12 mengine_in.write(molblock_in)
13 mengine_in.close()
14 molblock_out = mengine_out.read()
15 print molblock_out,
16 print mengine_err.read(),