-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJan292026_FileManagement.py
More file actions
31 lines (25 loc) · 886 Bytes
/
Copy pathJan292026_FileManagement.py
File metadata and controls
31 lines (25 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
file=open("tops1.txt","w")
file.write("This is File Management using Python.")
file.close()
print("File Written Successfully.")
print("-----------------------------------------------------")
file=open("tops1.txt","r")
print(file.read())
file.close()
print("-----------------------------------------------------")
file=open("tops1.txt","a")
file.write("\nThis file is now appended.")
file.close()
print("File appended successfully.")
print("-----------------------------------------------------")
file=open("tops1.txt", "r")
print(file.read())
file.close()
print("-----------------------------------------------------")
file=open("tops2.txt", "w+")
file.write("This is w+ mode in file management using python.")
print("Current File Position :", file.tell())
file.seek(0)
print("File Data :", file.read())
file.close()
print("-----------------------------------------------------")