-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain3.py
More file actions
27 lines (26 loc) · 899 Bytes
/
Copy pathmain3.py
File metadata and controls
27 lines (26 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#main3
from part3 import *
from part1 import *
import sys
if __name__ == "__main__":
#get file path
command_line_args = sys.argv
filename = command_line_args[1] #Command_line_input: python main3.py filename
original_list,desired_list = parse(filename)
temp = makehash(original_list, desired_list)
#print('blah',temp)
ht = temp[0]
new_original_list = temp[1]
new_desired_list = temp[2]
dp = compute_DP_matrix(new_original_list, new_desired_list)
#print('blah2',dp)
actions = process_DP_matrix(new_original_list,new_desired_list,dp)
#print('blah3',actions)
#print(print_best_path(actions))
#best = get_best_path(final2)
best2 = generate2(actions,ht)
# write to file
#print('a',best2)
with open(filename[0:len(filename)-3] + ".out" , "w") as output_file:
for line in best2:
output_file.write(line + "\n")