English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
writeable() The method checks if the file is writable.
Syntax
The syntax of the writeable() method is as follows:
file.writable()
No parameters.
If the file is writable, the writable() method returns True, otherwise it returns False.
If a file is opened with "a" for appending or with "w" for writing, then the file is writable.
The following example demonstrates the use of the writable() method:
f = open("w3codebox.txt, "a") print(f.writable())
The output result of the above example is as follows:
True