From aa980a545b3ba365f59504f81692ebcec213f17c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:58:06 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- file_handling/read_file.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/file_handling/read_file.py b/file_handling/read_file.py index fcc1d57982b5..3a2aeec47883 100644 --- a/file_handling/read_file.py +++ b/file_handling/read_file.py @@ -1,16 +1,18 @@ # Relative path def read_file(): - fp = open(r'test_file.txt', 'r') - # read file - text = (fp.read()) - # Closing the file after reading - fp.close() - """ + fp = open(r"test_file.txt", "r") + # read file + text = fp.read() + # Closing the file after reading + fp.close() + """ >>> read_file() >>> print("Hello World!") """ - return text + return text + if __name__ == __main__: - from doctest import testmod - testmod() + from doctest import testmod + + testmod()