annotate reactivity_cal/read_file.py @ 39:c5f80e82efb7 draft

Uploaded
author tyty
date Mon, 20 Oct 2014 14:57:26 -0400
parents 7a8ddf1819b1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
1 #!/usr/bin/env python
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
2 # -*- coding: utf-8 -*-
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
3
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
4 import sys
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
5
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
6
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
7
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
8 def read_t_file(in_file):
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
9 f = open(in_file);
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
10 result = [];
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
11 for aline in f.readlines():
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
12 temp = [];
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
13 tline = aline.strip();
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
14 tl = tline.split('\t');
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
15 for i in range(0, len(tl)):
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
16 temp.append(tl[i].strip());
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
17 result.append(temp);
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
18 f.close();
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
19 return result;
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
20
7a8ddf1819b1 Uploaded
tyty
parents:
diff changeset
21