annotate Iterative_mapping/read_s_file.py @ 87:5a9183ec344f draft

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