Files
with open("employees.txt","r") as employee_file:
print(employee_file.readable())
print(employee_file.readline())
print(employee_file.readline())
print(employee_file.readline()[2])
employee_file.close()
with open("myfile.txt", "w") as file1:
L = ["This is Delhi \n", "This is Paris \n", "This is London"]
file1.writelines(L)
with open("myfile.txt", "a") as file1:
file1.write("Today \n")
with open("myfile.txt", "r") as file1:
print("Output of Readlines after appending")
print(file1.read())
print()
with open("myfile.txt", "w") as file1:
file1.write("Tomorrow \n")
with open("myfile.txt", "r") as file1:
print("Output of Readlines after writing")
print(file1.read())
print()