Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d53e855

Browse files
Adding UTF-8 encoding to read files
1 parent 84d890c commit d53e855

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎random_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def rawCount(filename):
5050

5151
def randomLine(filename):
5252
num = int(random.uniform(0, rawCount(filename)))
53-
with open(filename, 'r') as f:
53+
with open(filename, 'r', encoding="UTF-8") as f:
5454
for i, line in enumerate(f, 1):
5555
if i == num:
5656
break

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /