Hi, and welcome to this Python tutorials. In this video, I will go I will discuss about file object attributes. These are some file object attributes like file dot closed file dot mod file dot name, file dot source face, to most file attributes also their encoding and new lines. Let's start with file dot closed. It returns a Boolean indicating the current state of the file object. It returns true if the file is closed and false.
When the file is open. And file dot mode. It is the idle mode for the file. If the file was created using the open building function, this will be the value of the mode parameter, file dot name. The file object was created using open the name of the file then file dot source space, it is a Boolean that indicates whether a space character needs to be printed before another value when using the print statement and filed or encoding. The encoding that is used.
In file we use when Unicode strings are returned to a file they will be converted to byte strings using this encoding then new lines of file object debt has been opening universal new line mode have these attributes which reflect the new line convention used in the files. The value of this attributes can be slash our carriage return slash and new line and etc none also with their aura tupple containing all the Nuland steps that seem so late Perform. Open your button ID idle. Mention the file name and the mode with which we are using. I'm using append mode here. No print by name c file dot name, App Lock.
Now let's look for other attributes encoding and then mod and Last new line and coding mode closed new lines see file name, app log encoding used in this file cp 1252 this is for window and for Linux UTF eight will be there file mode append plus which I used here, file closed false because files open I am not close this file, file new line none. Suppose, here I perform close operation now run the script in this way I completed file object attributes. So, till now happy coding, keep learning Learning and keep moving