writable(): checks if a file object supports write operations

Syntax

file_object.writable()
Returns Boolean value True or False. Returns True if file is writable , otherwise False .

In file read mode ( r )

fob=open('data1.txt','r')
print(fob.writable()) # False

Using write mode

fob=open('data1.txt','w')
print(fob.writable()) # True

Using append mode

fob=open('data1.txt','a')
print(fob.writable()) # True

Using read and write

fob=open('data1.txt','+a')
print(fob.writable()) # True
Moving the file position by seek()

File Append File Write


Subscribe to our YouTube Channel here



plus2net.com







Python Video Tutorials
Python SQLite Video Tutorials
Python MySQL Video Tutorials
Python Tkinter Video Tutorials
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2026   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer