From 930ee78cc68e2dc83983e13c518b78e133dbbcba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Epit=C3=A1cio?= <bessa.epitacio@gmail.com> Date: Wed, 24 Oct 2018 10:31:33 -0300 Subject: [PATCH] =?UTF-8?q?Pequeno=20acr=C3=A9scimo=20no=20sorted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sorting/sort.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sorting/sort.py b/sorting/sort.py index 3547b0c..05af340 100644 --- a/sorting/sort.py +++ b/sorting/sort.py @@ -1,10 +1,10 @@ from contextlib import redirect_stdout import locale -locale.setlocale(locale.LC_COLLATE, '') +locale.setlocale(locale.LC_COLLATE, 'pt_BR.UTF-8') with open("rotulos.in", encoding="utf-8") as f: ordered = sorted([line.strip() for line in f.readlines()], key=locale.strxfrm) with open("rotulos.out", "w", encoding="utf-8") as f: with redirect_stdout(f): - print("\n".join(ordered)) \ No newline at end of file + print("\n".join(ordered)) -- GitLab