Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c5cf1ad2 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Fix bug in solution sort: \n was not written

parent 666193d0
No related branches found
No related tags found
No related merge requests found
...@@ -10,11 +10,15 @@ def sort_solutions(file): ...@@ -10,11 +10,15 @@ def sort_solutions(file):
with open(file, 'r+') as fd: with open(file, 'r+') as fd:
for line in fd: for line in fd:
line = line.rstrip('\n')
# Remove possible \t separator from first line (frontier solution) # Remove possible \t separator from first line (frontier solution)
line = line.rstrip('\n')
stripped_line = line.rstrip('\t').replace('\t', ' ') stripped_line = line.rstrip('\t').replace('\t', ' ')
if stripped_line[0] not in ('%', '=', ' ', ''): # Next line if empty line
if stripped_line == '':
continue
if stripped_line[0] not in ('%', '=', ' '):
# print(stripped_line) # print(stripped_line)
# Sort in lower case, remove ' ' empty elements # Sort in lower case, remove ' ' empty elements
solutions[line] = \ solutions[line] = \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment