8000 Removed os.linesep - not recommended as a line ending on files opened… · github112017/practice-python@44815fe · GitHub
[go: up one dir, main page]

Skip to content

Commit 44815fe

Browse files
committed
Removed os.linesep - not recommended as a line ending on files opened in text mode (default)
1 parent 3b5f63e commit 44815fe

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

experiments/number-test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21

32

43
def main():
@@ -12,7 +11,7 @@ def main():
1211
output.append(line_number * int(line.rstrip()))
1312

1413
output_handle = open(output_file, "w")
15-
output_handle.write(os.linesep.join(str(n) for n in output))
14+
output_handle.write('\n'.join(str(n) for n in output))
1615

1716

1817
if __name__ == "__main__":

0 commit comments

Comments
 (0)
0