ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/src/mengine/src/mengine.py
Revision: 32
Committed: Fri Jul 18 18:50:15 2008 UTC (14 years, 1 month ago) by tjod
File size: 685 byte(s)
Log Message:
correct python script to use mengine.exe

Line User Rev File contents
1 tjod 14 import os
2    
3 tjod 32 cmd = os.curdir + os.sep + "mengine.exe -dxi"
4 tjod 14 # 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 tjod 32 #for molblock_in in (file("caffeine.sdf").read()).split('$$$$\n'):
10     #for molblock_in in (file("acaffeine.sdf").read()).split('$$$$\n'):
11 tjod 14 if len(molblock_in) > 0:
12 tjod 17 mengine_in, mengine_out, mengine_err = os.popen3(cmd)
13 tjod 14 mengine_in.write(molblock_in)
14     mengine_in.close()
15     molblock_out = mengine_out.read()
16     print molblock_out,
17 tjod 17 print mengine_err.read(),