
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Python File Methods MethodDescription Close() Closes the file Detach() Returns the separated raw stream from the buffer Fileno() Returns a number that represents the stream, from the operating system’s perspective Flush() Flushes the internal buffer Isatty() Returns whether the file stream is interactive or not Read() Returns the file content Readable() Returns whether the file stream can be read or not Readline() Returns one line from the file Readlines() Returns a list of lines from the file Seek() Change the file position Seekable() Returns whether the file allows us to change the file position Tell() Returns the current file position Truncate() Resizes the file to a specified size Writable() Returns whether the file can be written to or not Write() Writes the specified string to the file Writelines() Writes a list of strings to the file