- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFile_close().py
More file actions
Latest commit
20 lines (13 loc) · 400 Bytes
/
Copy pathFile_close().py
File metadata and controls
20 lines (13 loc) · 400 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Python File close() Method
# Example
# Close a file after it has been opened:
f=open("demofile.txt", "r")
print(f.read())
f.close()
# Definition and Usage
# The close() method closes an open file.
# You should always close your files, in some cases, due to buffering, changes made to a file may not show until you close the file.
# Syntax
# file.close()
# Parameter Values
# No parameters