file_object.writable()
Returns Boolean value True or False. Returns True if file is writable , otherwise False .
fob=open('data1.txt','r')
print(fob.writable()) # False
fob=open('data1.txt','w')
print(fob.writable()) # True
fob=open('data1.txt','a')
print(fob.writable()) # True
fob=open('data1.txt','+a')
print(fob.writable()) # True
Moving the file position by seek()
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.