ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/branches/sync4pymol12/src/mengine/src/mengine.py
Revision: 93
Committed: Sat Jan 17 23:24:55 2009 UTC (13 years, 4 months ago) by wdelano
File size: 685 byte(s)
Log Message:
branch created
Line File contents
1 import os
2
3 cmd = os.curdir + os.sep + "mengine.exe -dxi"
4 # mengine will read multi-molblock sdf files,
5 # but calling through popen2 with some (large?) files hangs on windows,
6 # even though the same file runs fine at command line.
7 # So, split into separate files.
8 for molblock_in in (file("drugs.sdf").read()).split('$$$$\n'):
9 #for molblock_in in (file("caffeine.sdf").read()).split('$$$$\n'):
10 #for molblock_in in (file("acaffeine.sdf").read()).split('$$$$\n'):
11 if len(molblock_in) > 0:
12 mengine_in, mengine_out, mengine_err = os.popen3(cmd)
13 mengine_in.write(molblock_in)
14 mengine_in.close()
15 molblock_out = mengine_out.read()
16 print molblock_out,
17 print mengine_err.read(),