annotate Iterative_mapping/remove_map.py @ 119:7bb98e9296e9 draft default tip

Uploaded
author tyty
date Tue, 14 Apr 2015 14:18:40 -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 from read_file import *
d56631911cc1 Uploaded
tyty
parents:
diff changeset
6
d56631911cc1 Uploaded
tyty
parents:
diff changeset
7
d56631911cc1 Uploaded
tyty
parents:
diff changeset
8 unmap_file = sys.argv[1]
d56631911cc1 Uploaded
tyty
parents:
diff changeset
9 map_file = sys.argv[2]
d56631911cc1 Uploaded
tyty
parents:
diff changeset
10 result_file = sys.argv[3]
d56631911cc1 Uploaded
tyty
parents:
diff changeset
11
d56631911cc1 Uploaded
tyty
parents:
diff changeset
12
d56631911cc1 Uploaded
tyty
parents:
diff changeset
13 unmap = read_t_file(unmap_file)
d56631911cc1 Uploaded
tyty
parents:
diff changeset
14 mapped = read_t_file(map_file)
d56631911cc1 Uploaded
tyty
parents:
diff changeset
15 h = file(result_file, 'w')
d56631911cc1 Uploaded
tyty
parents:
diff changeset
16
d56631911cc1 Uploaded
tyty
parents:
diff changeset
17 maps = set()
d56631911cc1 Uploaded
tyty
parents:
diff changeset
18 for i in range(len(mapped)):
d56631911cc1 Uploaded
tyty
parents:
diff changeset
19 maps.add(mapped[i][0])
d56631911cc1 Uploaded
tyty
parents:
diff changeset
20
d56631911cc1 Uploaded
tyty
parents:
diff changeset
21
d56631911cc1 Uploaded
tyty
parents:
diff changeset
22 for i in range(len(unmap)):
d56631911cc1 Uploaded
tyty
parents:
diff changeset
23 name = unmap[i][0]
d56631911cc1 Uploaded
tyty
parents:
diff changeset
24 if name not in maps:
d56631911cc1 Uploaded
tyty
parents:
diff changeset
25 h.write(name)
d56631911cc1 Uploaded
tyty
parents:
diff changeset
26 h.write('\n')
d56631911cc1 Uploaded
tyty
parents:
diff changeset
27
d56631911cc1 Uploaded
tyty
parents:
diff changeset
28
d56631911cc1 Uploaded
tyty
parents:
diff changeset
29 h.close()