Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
avaliacao2-lp2
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Epitácio Bessa da Silva
avaliacao2-lp2
Commits
930ee78c
Commit
930ee78c
authored
6 years ago
by
Epitácio Bessa da Silva
Browse files
Options
Downloads
Patches
Plain Diff
Pequeno acréscimo no sorted
parent
b83af4e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sorting/sort.py
+2
-2
2 additions, 2 deletions
sorting/sort.py
with
2 additions
and
2 deletions
sorting/sort.py
+
2
−
2
View file @
930ee78c
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment