Skip to content
Snippets Groups Projects
Commit 930ee78c authored by Epitácio Bessa da Silva's avatar Epitácio Bessa da Silva
Browse files

Pequeno acréscimo no sorted

parent b83af4e0
No related branches found
No related tags found
No related merge requests found
from contextlib import redirect_stdout from contextlib import redirect_stdout
import locale 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: with open("rotulos.in", encoding="utf-8") as f:
ordered = sorted([line.strip() for line in f.readlines()], key=locale.strxfrm) ordered = sorted([line.strip() for line in f.readlines()], key=locale.strxfrm)
with open("rotulos.out", "w", encoding="utf-8") as f: with open("rotulos.out", "w", encoding="utf-8") as f:
with redirect_stdout(f): with redirect_stdout(f):
print("\n".join(ordered)) print("\n".join(ordered))
\ No newline at end of file
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