WEBVTT

00:02.070 --> 00:04.530
So let's continue working with the tax data.

00:05.250 --> 00:11.620
So in the last video, we have learned how to read this CSC file and how to write into a CSA fight.

00:12.060 --> 00:18.840
But that is all based on all those fancy functions are available inside this Third-Party library pangas,

00:19.380 --> 00:23.480
how they can deal with the inbuilt functions that are available in a patent.

00:23.940 --> 00:29.820
So something like open function or like function, read, function, how we can use it.

00:30.360 --> 00:32.670
And for doing that, we need some fine.

00:33.000 --> 00:39.360
So first to recreate one file and then with the with the help of this building functions available in

00:39.360 --> 00:40.630
a python code.

00:41.580 --> 00:45.180
How we can redefine and how we can write into a file.

00:46.390 --> 00:51.170
So to create the file, we can just simply magically use this Jupiter cell.

00:51.370 --> 00:58.240
There are some magic commands available to do tasks like reading file and writing into files.

00:59.990 --> 01:01.990
So we can use like a double percentage.

01:03.340 --> 01:03.800
Let's see.

01:04.650 --> 01:06.270
All right, fine.

01:08.020 --> 01:10.870
Let me give you the name like this one.

01:11.480 --> 01:12.580
Dee da Dee Dee.

01:14.610 --> 01:15.390
Let me, Lenny.

01:17.520 --> 01:23.400
Hopes it says that the cell body is empty because of the creation of file.

01:23.690 --> 01:25.830
You can go and refresh it.

01:26.340 --> 01:27.040
There is no file.

01:27.240 --> 01:33.150
God created software that you how to write some text because what you are going to write inside this

01:33.150 --> 01:34.380
takes place to undock.

01:34.730 --> 01:35.220
Define.

01:36.440 --> 01:44.210
Let's say will give the contain like, hello, this is Tesfai.

01:45.630 --> 01:53.730
Let's say this is the first line ups and this is the second line.

01:54.630 --> 01:57.990
Let me make it like any flexicurity.

01:59.250 --> 02:02.910
You can see the writing and do a test, one to fight.

02:03.660 --> 02:10.410
You can go to the file explorer and you can see based on that text file got created, Double-Click,

02:10.500 --> 02:11.980
click on it and verified.

02:12.840 --> 02:19.640
And you'd be able to see it's what created and has been written with this text like Miklosi.

02:20.890 --> 02:24.250
Now, suppose in the same file if you want to paint something.

02:25.790 --> 02:29.390
So same magic function you can use, but.

02:30.640 --> 02:32.530
With one argument, let's say hi.

02:33.940 --> 02:36.840
A taste when not the extreme.

02:38.250 --> 02:44.470
So let's say Harry in pain mode.

02:45.580 --> 02:46.030
All right.

02:47.180 --> 02:49.310
So this week, file got created.

02:49.460 --> 02:50.810
And let's just verify.

02:53.600 --> 02:59.550
Swelling in pain more, and you can see there is no sless in that side as appendix, along with the

02:59.550 --> 03:02.750
very last character after the very last character of this fight.

03:03.270 --> 03:03.590
All right.

03:03.900 --> 03:04.530
But that's OK.

03:04.800 --> 03:05.880
Her file got created.

03:06.330 --> 03:07.050
Now we'll see.

03:07.710 --> 03:13.860
With the help of building functions available in a pipe and how we can read this, page one not to define.

03:15.950 --> 03:19.130
And for that, we are going to use these simple open function.

03:20.360 --> 03:23.270
Let me give you taste one.

03:23.980 --> 03:24.960
Not the 60.

03:25.850 --> 03:31.790
And now, along with the file name, there are a number of options are available, like what you are

03:31.790 --> 03:34.880
going to do with Despain, whether you want to read this file.

03:34.990 --> 03:39.320
You know, reading more, writing more or some spending more.

03:39.920 --> 03:41.810
So if you just see the documentation.

03:44.490 --> 03:49.950
The very first place he admits it's what it takes, learning more.

03:50.100 --> 03:51.630
And we are going to read this fine.

03:52.830 --> 03:53.370
Read more.

03:53.550 --> 03:54.530
So let me just skip it.

03:57.240 --> 03:58.630
That will be nothing more.

03:59.430 --> 04:01.440
And let me assign it to some fine point.

04:01.800 --> 04:02.900
A fine object.

04:04.570 --> 04:07.700
Let's see if I tried to display this file object.

04:08.950 --> 04:11.020
It will be a kind of tax.

04:11.140 --> 04:13.150
Are you able to kind of plus.

04:14.640 --> 04:22.350
Now, suppose if you want to read this, fine, you can just simply use that lead function and all the

04:22.350 --> 04:26.870
contents are really well in this file going, that will be read in a one shot.

04:28.090 --> 04:34.780
Suppose if you try to read the same thing again, let's say so, fail to read.

04:37.950 --> 04:39.990
All right, so now you can see what happens.

04:40.380 --> 04:48.270
We got the blank, empty string, so here the file point, that is the very first time pointing to very

04:48.270 --> 04:55.810
first character of this test, went out to define the moment you viewed one moment to apply this real

04:55.830 --> 04:58.050
function on the top of this file object.

04:58.530 --> 05:00.720
It has already reached the end of the file.

05:01.110 --> 05:04.350
Now, after the end of the file, there is no character left.

05:04.620 --> 05:06.390
So there is nothing to read.

05:06.660 --> 05:12.300
So in that case, again, you have to open this file and you have to put this puzzle at a very stark

05:12.600 --> 05:13.120
location.

05:14.810 --> 05:17.560
But there is some other mechanism also, like a.

05:18.440 --> 05:22.810
So you can use like a sick function and make it to zero Lachman's.

05:22.880 --> 05:26.780
Now we are pointing to at the very start of the stream of the fight.

05:27.380 --> 05:34.940
And after that, let's say if you try to read, you will be able to read this whole file.

05:35.550 --> 05:38.160
One second simply of a.

05:41.250 --> 05:47.370
Let's say if you want to make this file or seek at some other location, let's say one.

05:49.660 --> 05:50.020
And.

05:51.510 --> 05:59.820
After that, if you just try to really file Naukri, you can observe that the very first character,

05:59.910 --> 06:07.140
it won't be able to read because now we are seeking from the first position and one is pointing here

06:07.290 --> 06:10.380
to the E, not at the very first character of the.

06:13.070 --> 06:19.640
Now, let me make this stick to those zero and we will see some other matter.

06:20.400 --> 06:22.130
To read the same fine.

06:24.130 --> 06:32.120
So it is not just that we can lead with the help of this read function, but we how like all read lines.

06:32.740 --> 06:35.080
So we'll we only know we have a clue.

06:35.080 --> 06:42.330
Lines are available and all the lines we will get has a very loose inside the list object.

06:43.840 --> 06:51.940
Let me go to the first audition in a sec again, and I will show you how you can understand why I have

06:51.940 --> 06:52.660
to do this.

06:52.840 --> 06:53.650
Seek a deal.

06:53.770 --> 06:58.350
Again and again, because I want to put my cursor at the very first I sent, you know.

06:59.830 --> 07:05.800
So this will every single line and put it in two different different values in less.

07:06.490 --> 07:10.510
But there will be one more function, like a lead line.

07:10.960 --> 07:13.620
Now it just hopes it will be a lead.

07:15.930 --> 07:16.260
Line.

07:17.200 --> 07:23.370
Now, just make sure that this is a lead line, so every single line, it will read it here, it's a

07:23.370 --> 07:24.210
V line.

07:24.300 --> 07:27.120
So one by one line it will really.

07:27.570 --> 07:31.140
So now you can see only first line got read.

07:31.620 --> 07:36.420
If I just execute it again, the second line will read.

07:36.900 --> 07:42.190
So this way, if you want to read this file in some sort of file, one by one, line by line, really,

07:42.420 --> 07:44.040
you can put it in inside for.

07:46.160 --> 07:49.490
And let's say if you try to run it once more.

07:50.690 --> 07:52.730
The moment you leap to the end of the fight.

07:52.820 --> 07:54.270
Let me do it once again.

07:55.700 --> 07:57.340
Whoops, there is nothing left.

07:59.730 --> 08:01.590
So you can make C zero.

08:01.740 --> 08:03.750
And again, you can read every single line.

08:04.870 --> 08:10.960
Now, suppose if you want to check whether Feis position is open or closed.

08:11.250 --> 08:14.080
You can use Leiker is underscore.

08:15.470 --> 08:16.910
Hopes it will be a close.

08:17.960 --> 08:22.010
So as of now, it will be kind of nice because file is not close.

08:22.490 --> 08:25.430
You can explicitly make a file like of close.

08:26.080 --> 08:31.160
Now, once you make the file closed, you just cannot apply any operation afterwards.

08:31.520 --> 08:36.220
And it is always a good practice that you close the file after you do all those operations.

08:36.560 --> 08:43.790
So suppose if I tried to read, you can see what errors will get.

08:44.480 --> 08:49.310
So that will be like how you operation on a closed pipe because file is closed and you are trying to

08:49.310 --> 08:50.510
do those operation.

08:52.890 --> 08:54.890
So here we hold explicitly open the file.

08:55.410 --> 08:58.230
And after doing all those operations, we have to close this fight.

08:58.790 --> 09:00.750
But suppose you don't want to close it.

09:01.770 --> 09:08.940
So that is one method like a you can use a result were available in a fighting and you can use like

09:08.940 --> 09:09.420
open.

09:10.320 --> 09:20.920
Let me use this one, not the extreme inner deal more, let's say, as five.

09:21.390 --> 09:25.100
So despite going to exactly the same as our lead file binder.

09:26.760 --> 09:38.430
And let me bring this file, not, you know, in such a condition, you will be able to see that this

09:38.430 --> 09:38.870
spring.

09:40.420 --> 09:42.420
He's inside this week.

09:43.150 --> 09:44.770
That means everything.

09:46.170 --> 09:53.020
Whatever operation you are being related to fight that is inside the sandbox of, you can see this veto

09:53.120 --> 09:53.450
block.

09:53.790 --> 09:56.270
So you do not need to worry about this closing the fight.

09:56.310 --> 10:02.220
The moment you come out from this V block automatically file closing will be the.

10:05.010 --> 10:12.880
Now, if you observe our original file, this one thing that will be us less than exist, end of the

10:13.050 --> 10:14.160
every single line.

10:14.570 --> 10:16.970
Suppose you want to remove that lesson.

10:17.490 --> 10:21.090
So one by one, while Rudy let me know.

10:21.330 --> 10:23.370
Same thing with this roadblock.

10:24.180 --> 10:30.840
And after reading, it will return a string object so we can apply like hopes it will be a strict.

10:34.280 --> 10:34.490
So.

10:35.060 --> 10:40.890
Anyhow, it is not going to bring that lesson, but obviously you can do more.

10:41.190 --> 10:47.750
All those whitespace character nine such a case when you use the brain function, you won't be able

10:47.750 --> 10:50.590
to get those noticeable difference.

10:51.840 --> 10:56.540
All right, so most live heard that in this video, how to lead the fight in the next video.

10:56.570 --> 10:58.880
We will see how to add lighting to find.
