Reference group
>File Methods
Ways to read, write, move through, and manage open files. 16 entries.
close()file.close()Flush and close the open file handle.detach()file.detach()Separate the underlying binary buffer from the text stream and return it.fileno()file.fileno()Return the integer file descriptor used by the underlying operating system.flush()file.flush()Flush write buffers directly to disk without closing the file.isatty()file.isatty()Return True if the file stream is interactive (connected to a terminal device).read()file.read(size=-1)Read at most size characters or bytes from the file.readable()file.readable()Return True if the file stream can be read from.readline()file.readline(size=-1)Read and return one line from the file.readlines()file.readlines(hint=-1)Read all remaining lines into a list of strings.seek()file.seek(offset, whence=0)Change the file stream position to the given offset.seekable()file.seekable()Return True if the file stream supports random access positioning.tell()file.tell()Return the current stream position in the file.truncate()file.truncate(size=None)Resize the file stream to the specified byte size.writable()file.writable()Return True if the file stream can be written to.write()file.write(string)Write a string or bytes to the file stream.writelines()file.writelines(lines)Write a sequence of string lines to the file.
Looking for something else?
All reference groups