So let's continue working with the tax data.
So in the last video, we have learned how to read this CSC file and how to write into a CSA fight.
But that is all based on all those fancy functions are available inside this Third-Party library pangas,
how they can deal with the inbuilt functions that are available in a patent.
So something like open function or like function, read, function, how we can use it.
And for doing that, we need some fine.
So first to recreate one file and then with the with the help of this building functions available in
a python code.
How we can redefine and how we can write into a file.
So to create the file, we can just simply magically use this Jupiter cell.
There are some magic commands available to do tasks like reading file and writing into files.
So we can use like a double percentage.
Let's see.
All right, fine.
Let me give you the name like this one.
Dee da Dee Dee.
Let me, Lenny.
Hopes it says that the cell body is empty because of the creation of file.
You can go and refresh it.
There is no file.
God created software that you how to write some text because what you are going to write inside this
takes place to undock.
Define.
Let's say will give the contain like, hello, this is Tesfai.
Let's say this is the first line ups and this is the second line.
Let me make it like any flexicurity.
You can see the writing and do a test, one to fight.
You can go to the file explorer and you can see based on that text file got created, Double-Click,
click on it and verified.
And you'd be able to see it's what created and has been written with this text like Miklosi.
Now, suppose in the same file if you want to paint something.
So same magic function you can use, but.
With one argument, let's say hi.
A taste when not the extreme.
So let's say Harry in pain mode.
All right.
So this week, file got created.
And let's just verify.
Swelling in pain more, and you can see there is no sless in that side as appendix, along with the
very last character after the very last character of this fight.
All right.
But that's OK.
Her file got created.
Now we'll see.
With the help of building functions available in a pipe and how we can read this, page one not to define.
And for that, we are going to use these simple open function.
Let me give you taste one.
Not the 60.
And now, along with the file name, there are a number of options are available, like what you are
going to do with Despain, whether you want to read this file.
You know, reading more, writing more or some spending more.
So if you just see the documentation.
The very first place he admits it's what it takes, learning more.
And we are going to read this fine.
Read more.
So let me just skip it.
That will be nothing more.
And let me assign it to some fine point.
A fine object.
Let's see if I tried to display this file object.
It will be a kind of tax.
Are you able to kind of plus.
Now, suppose if you want to read this, fine, you can just simply use that lead function and all the
contents are really well in this file going, that will be read in a one shot.
Suppose if you try to read the same thing again, let's say so, fail to read.
All right, so now you can see what happens.
We got the blank, empty string, so here the file point, that is the very first time pointing to very
first character of this test, went out to define the moment you viewed one moment to apply this real
function on the top of this file object.
It has already reached the end of the file.
Now, after the end of the file, there is no character left.
So there is nothing to read.
So in that case, again, you have to open this file and you have to put this puzzle at a very stark
location.
But there is some other mechanism also, like a.
So you can use like a sick function and make it to zero Lachman's.
Now we are pointing to at the very start of the stream of the fight.
And after that, let's say if you try to read, you will be able to read this whole file.
One second simply of a.
Let's say if you want to make this file or seek at some other location, let's say one.
And.
After that, if you just try to really file Naukri, you can observe that the very first character,
it won't be able to read because now we are seeking from the first position and one is pointing here
to the E, not at the very first character of the.
Now, let me make this stick to those zero and we will see some other matter.
To read the same fine.
So it is not just that we can lead with the help of this read function, but we how like all read lines.
So we'll we only know we have a clue.
Lines are available and all the lines we will get has a very loose inside the list object.
Let me go to the first audition in a sec again, and I will show you how you can understand why I have
to do this.
Seek a deal.
Again and again, because I want to put my cursor at the very first I sent, you know.
So this will every single line and put it in two different different values in less.
But there will be one more function, like a lead line.
Now it just hopes it will be a lead.
Line.
Now, just make sure that this is a lead line, so every single line, it will read it here, it's a
V line.
So one by one line it will really.
So now you can see only first line got read.
If I just execute it again, the second line will read.
So this way, if you want to read this file in some sort of file, one by one, line by line, really,
you can put it in inside for.
And let's say if you try to run it once more.
The moment you leap to the end of the fight.
Let me do it once again.
Whoops, there is nothing left.
So you can make C zero.
And again, you can read every single line.
Now, suppose if you want to check whether Feis position is open or closed.
You can use Leiker is underscore.
Hopes it will be a close.
So as of now, it will be kind of nice because file is not close.
You can explicitly make a file like of close.
Now, once you make the file closed, you just cannot apply any operation afterwards.
And it is always a good practice that you close the file after you do all those operations.
So suppose if I tried to read, you can see what errors will get.
So that will be like how you operation on a closed pipe because file is closed and you are trying to
do those operation.
So here we hold explicitly open the file.
And after doing all those operations, we have to close this fight.
But suppose you don't want to close it.
So that is one method like a you can use a result were available in a fighting and you can use like
open.
Let me use this one, not the extreme inner deal more, let's say, as five.
So despite going to exactly the same as our lead file binder.
And let me bring this file, not, you know, in such a condition, you will be able to see that this
spring.
He's inside this week.
That means everything.
Whatever operation you are being related to fight that is inside the sandbox of, you can see this veto
block.
So you do not need to worry about this closing the fight.
The moment you come out from this V block automatically file closing will be the.
Now, if you observe our original file, this one thing that will be us less than exist, end of the
every single line.
Suppose you want to remove that lesson.
So one by one, while Rudy let me know.
Same thing with this roadblock.
And after reading, it will return a string object so we can apply like hopes it will be a strict.
So.
Anyhow, it is not going to bring that lesson, but obviously you can do more.
All those whitespace character nine such a case when you use the brain function, you won't be able
to get those noticeable difference.
All right, so most live heard that in this video, how to lead the fight in the next video.
We will see how to add lighting to find.