the better method of I/O from file I am very new to python (probably too new to consider efficiency etc.). But I am bit confused about which method to use while reading a file for post-processing.
Here I am reading it line-by-line. There is other methods also for reading the file(e.g infile.read()), one of them is to load the complete file in memory.
Can someone kindly discuss this?

My code in current condition is:

#!/usr/bin/python
import sys,math,re
try:
  inf=sys.argv[1]
except:
    print "usage:", sys.argv[0], "argument"; sys.exit(1)

infile=sys.argv[1]; oufile=sys.argv[2]
ifile=open(infile, 'r'); ofile=open(oufile, 'w')
pattern=r'species,subl,cmp=\s{4}(.*)\s{4}(.*)\s{4}(.*)\s{3}s1,torque=(.{12})(.{12})'

ssc1=[];ssc2=[];ssc3=[]; s1=[]; t=[]
for line in ifile:
  match = re.search(pattern, line)
  if match:
    ssc1.   append(int(match.group(1)))
    s1.     append(float(match.group(4)))
    t.      append(float(match.group(5)))

for i in range(len(t)):
  print('%g %12.5e %12.5e' % (ssc1[i], s1[i], t[i]))

ifile.close(); ofile.close()
First, Where are you writing in ofile?

Second, ;) you can use with statement to opening and closing files like below:

pattern=r'species,subl,cmp=\s{4}(.*)\s{4}(.*)\s{4}(.*)\s{3}s1,torque=(.{12})(.{12})'
infile=sys.argv[1]; outfile=sys.argv[2]
with open(infile, "r") as ifile, open(outfile, "w") as ofile:
    for line in ifile:
        match = re.match(pattern, line)
        if match:
            ofile.write('%g %12.5e %12.5e' % (int(match.group(1)), float(match.group(4)), float(match.group(5))))