-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextract_thermoChem_summary.py
executable file
·36 lines (31 loc) · 1.43 KB
/
extract_thermoChem_summary.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os, sys, glob
from subprocess import call
'''
Extracts thermochemical corrections data. The output file from this python script is not easy to parse a better output orgainized as a data frame can be obtained from getfreqs.sh script written in bash.
'''
currentdir = ". "
for root, dirs, files in os.walk(".", topdown=False,):
for name in dirs:
currentdir = (os.path.join ( root,name ))
#print "this is a directory", (os.path.join(root, name))
for f in files:
#print "this is a file", (os.path.join(root, f))
pathtofile = (os.path.join(root, f))
if "Thermochemistry.txt" in pathtofile:
abspath = os.path.abspath(pathtofile)
print "found Thermochemistry.txt", pathtofile
#print "this is the abs path", abspath
with open ( pathtofile,'r' ) as fileobj:
textfile = " . "
for lines in fileobj:
textfile += lines
#print(text)
with open ( "ZPE_TS_Summary.txt","a" ) as outputfile:
print >> outputfile,"==============="
print >> outputfile, pathtofile
print >> outputfile,abspath,"\n"
print >> outputfile,textfile
print >> outputfile," "
print >> outputfile," "
print >> outputfile," "
print >> outputfile,"==============="