- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWritingFiles.py
More file actions
Latest commit
20 lines (15 loc) · 569 Bytes
/
Copy pathWritingFiles.py
File metadata and controls
20 lines (15 loc) · 569 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#Append Mode
company_designations=open("Employees.txt","a")
#Checking the writability
print(company_designations.writable())
#Appending text in document
company_designations.write("\nPrateek - Human Resources")
company_designations.close()
#Overriding By Write Mode
company_designations=open("Employees.txt","w")
company_designations.write("This is the first line of Employees.txt file")
company_designations.close()
#Finally reading out the file
company_designations=open("Employees.txt","r")
print(company_designations.read())
company_designations.close()