Hi and welcome back. In this part I will discuss about file object methods, which are very important in file handling with Python. First, file dot close. This is used for closing the file. File dot flush. It is used to flush the internal buffers file dot fine number it returns an integer like descriptor file.is x y it returns true if the file has a TTY attached to it.
File dot next, it returns the next line from the last offset file dot read size reads the given number of bytes it may be read less if he have is not hit five is read line size. It will read an entire line reading with a new line care for the file. File dot read line size hint it calls the read line to read until II o f it returns a list of lines read from the file if you pass size hint then it reads line equally the size in bytes seek Spitzer's the files current position, then returns the files current position, truncate it truncates the file size. If the optional size argument is present, the file is truncated to at that size. Right. It writes a string to the file it does not return any value.
Right lines write a sequence of strings to the files the sequence is possibly an iterable object producing strings typically are list of strings. These are all the file objects present and used in file handling with Python. In my next video, I will give demonstration of all this object matters. So till now, happy coding, keep learning and keep moving