We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 707e325 commit aa980a5Copy full SHA for aa980a5
file_handling/read_file.py
@@ -1,16 +1,18 @@
1
# Relative path
2
def read_file():
3
- fp = open(r'test_file.txt', 'r')
4
- # read file
5
- text = (fp.read())
6
- # Closing the file after reading
7
- fp.close()
8
- """
+ fp = open(r"test_file.txt", "r")
+ # read file
+ text = fp.read()
+ # Closing the file after reading
+ fp.close()
+ """
9
>>> read_file()
10
>>> print("Hello World!")
11
"""
12
- return text
+ return text
13
+
14
15
if __name__ == __main__:
- from doctest import testmod
16
- testmod()
+ from doctest import testmod
17
18
+ testmod()
0 commit comments