annotate Iterative_mapping/read_s_file.py @ 112:87ec0ecdc2af draft

Uploaded
author tyty
date Sun, 12 Apr 2015 14:28:30 -0400
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