WEBVTT

00:01.230 --> 00:02.320
Hello, everyone.

00:02.730 --> 00:11.280
In this particular session, we would learn about creating a new file on how we will be homophily,

00:11.280 --> 00:13.330
how we can write that will file.

00:13.710 --> 00:20.880
So this particular session is completely devoted on the file handling, which we will be doing so that

00:21.210 --> 00:26.070
you get to know how you can open different files right through a file, read from a file, all those

00:26.070 --> 00:26.400
things.

00:27.510 --> 00:34.430
So the very first thing which I would like to show you is this ID, which is final.

00:35.280 --> 00:39.150
It comes along with the Anakonda installation.

00:40.200 --> 00:43.560
If you want, you can install any other IVI.

00:43.770 --> 00:45.630
There is no restrictions.

00:46.080 --> 00:49.760
Most of the IDs look a little different.

00:49.860 --> 00:57.180
Just same kind of things are present in all the IDs you will have on a video which will just allow you

00:57.180 --> 00:59.290
to type something and get them out footer.

00:59.430 --> 01:03.690
So for example, I can see something like print.

01:06.740 --> 01:09.110
One, two, three, and.

01:10.640 --> 01:19.130
I'll put this in quotes and I can simply run this and it will give me an output indispensably.

01:20.820 --> 01:28.980
In case of Python, we can have an interactive look also with what we can do is we can directly use

01:28.980 --> 01:34.240
this console here so you can increase the size, decrease the size of it.

01:34.260 --> 01:35.700
You can do anything like that.

01:36.090 --> 01:43.380
Now, what I am doing is I am using this control console here so I can do something like twenty three

01:44.010 --> 01:46.980
plus ninety eight and it gives me the desired.

01:47.400 --> 01:50.460
I can declare a variable c E is equal to.

01:51.420 --> 02:01.110
Fifty six, I say be is equal to two, and I can see E plus V, so it gives me the output corresponding

02:01.110 --> 02:01.360
good.

02:01.380 --> 02:04.290
So this is how an interactive console works.

02:05.520 --> 02:07.740
Now, let us do one thing.

02:08.010 --> 02:14.430
Let us first of all, create a file and then we will see how we can work with a particular.

02:17.920 --> 02:26.980
So for this particular session, I have needed a folder, so let me dig this file and see this file

02:26.980 --> 02:34.840
to that particular folder directory so I see you and then I will go to that particular folder of mine

02:35.050 --> 02:37.600
and I will say it was like old.

02:40.820 --> 02:41.570
So.

02:47.420 --> 02:52.160
This is the fault of Bichel and inside, by God, I'm creating.

02:53.620 --> 02:54.490
Read.

02:55.880 --> 02:56.710
Right.

02:58.700 --> 03:07.160
Don't fight, don't fight is the extension for any fight and fight which we will be creating so we can

03:07.160 --> 03:13.640
create a file on this file, will actually help us in running the fight.

03:14.570 --> 03:19.880
So let's create this particular faithful's, so I'll see you.

03:20.390 --> 03:22.250
And this file has been created.

03:23.850 --> 03:31.800
Now, what I can do is I can simply go ahead and start writing and creating my file.

03:33.190 --> 03:35.230
So let's get rid of this first.

03:37.020 --> 03:45.120
Now, there are a few important functions and important things which we do, why the Dingle file and

03:45.120 --> 03:46.210
why the go fight?

03:46.770 --> 03:50.640
So the first thing which we will do is we will open the file object.

03:51.210 --> 03:53.470
Now, how do we open a file object?

03:53.820 --> 04:00.530
We will create a file object, see, and I will say open.

04:00.870 --> 04:03.840
This means that I wanted to open a particular file.

04:04.970 --> 04:09.020
Now, when you see when I write open, it gives me two options.

04:10.520 --> 04:16.820
The one first one is saying F, which means it is a function and the second one is key, which means

04:16.820 --> 04:22.130
that I want to create a fuel, I want to use the existing function open.

04:22.880 --> 04:24.360
So I click on this.

04:25.010 --> 04:31.700
Now, if you see it shows me the difference of of Fatmeh Goes, which are presented this particular

04:31.700 --> 04:32.200
function.

04:32.690 --> 04:35.300
So you can see I can provide the five.

04:36.670 --> 04:38.160
I can give them more.

04:39.780 --> 04:40.690
And different other.

04:41.910 --> 04:45.710
So what I do is there are two important things which I need to hear.

04:46.230 --> 04:50.810
The first thing is the name of the file which I want to open.

04:51.480 --> 04:55.590
So the name of the files see the more one.

04:57.390 --> 05:01.930
Not the I want to create a demo and de.

05:03.880 --> 05:07.610
And I want to open it in a right.

05:08.770 --> 05:14.860
That is, I want to right off right now, there are different modes of operation, so let us read about

05:15.160 --> 05:16.540
different modes forced.

05:20.450 --> 05:28.010
So these are the three types of actions which we can perform when fight, the first action is to open

05:28.010 --> 05:37.060
a file in, read more, read more means that we want to read the fight and then we are leading the fight.

05:37.130 --> 05:45.590
We are not modifying the fight, which means that when I am reading a fight, one of my thinking also

05:45.590 --> 05:49.270
did a fight because we are not making any changes to the fight.

05:49.280 --> 05:52.440
So it will be convenient for both of us.

05:53.300 --> 06:01.590
The second one is W W stands for strike mode is the right.

06:02.240 --> 06:08.690
It means that I want to write a fight, that is, I want to create a new fight.

06:09.350 --> 06:13.000
So I will use W.M. whenever I want to create a new fight.

06:14.830 --> 06:18.260
So that is what we use for writing the fight.

06:18.850 --> 06:27.720
Now, that is the third option of being witches, then we will go right back to pre existing fight.

06:28.120 --> 06:31.030
That is, I don't want to override the five.

06:32.170 --> 06:37.650
I want to add some content to my fight, so that is when the use of pain.

06:38.470 --> 06:46.810
So in this case, when we are trying to write, when we are trying to create a new fight, we will say

06:47.050 --> 06:49.630
w OK, so let's go back.

06:50.440 --> 06:55.690
So this is the fight which I was trying to read and I'll see W.

06:57.240 --> 07:05.910
Which means that I want to light a fire, so I will just run this particular home and when I run this

07:05.910 --> 07:07.740
code, you can see.

07:09.450 --> 07:18.930
Run, and when you run the sport, you don't see anything coming out of you because I have not given

07:18.930 --> 07:22.120
any print statements, that is why I'm not giving any output here.

07:22.560 --> 07:23.930
Let's go back to the follow.

07:24.850 --> 07:32.650
Now, if you go to the folder here, you see that one spying has been created and the deed of Modify

07:32.650 --> 07:36.990
it is also for today and the name is Demo one, and it is a blank slate.

07:37.240 --> 07:39.550
So we have created a blank file here.

07:40.940 --> 07:42.320
Now, let me close this.

07:44.590 --> 07:45.970
And look, we believe this.

07:57.600 --> 07:57.900
OK.

07:57.990 --> 08:01.890
Seems like the file is open in fighting, so let's go back.

08:02.520 --> 08:04.490
Let's do one other thing.

08:05.040 --> 08:08.110
Let's try to read the fight.

08:08.220 --> 08:10.230
OK, so we'll see are.

08:12.070 --> 08:13.510
OK, we'll see.

08:13.800 --> 08:18.820
Ah, and we will change the name to something which is not existing, so we say that more than.

08:20.150 --> 08:22.100
OK, and now we will run this.

08:22.280 --> 08:27.980
So when we run this, you can see that we got this particular error, which is saying that no such file

08:27.980 --> 08:29.210
or directory is formed.

08:29.960 --> 08:37.640
So this means that if you have that file existing Vaillancourt, if the file is not existing and you

08:37.640 --> 08:41.300
run a reed operation, then it will give you an error.

08:41.810 --> 08:48.140
Now, if I again go to the demo to change it to Demo one and I will again read the fighting.

08:48.140 --> 08:50.840
Now in this case, the file is existing.

08:50.840 --> 08:51.720
You can see the demo.

08:51.720 --> 08:53.560
One file is already present here.

08:54.580 --> 08:58.780
So we will run this and now you can see that.

09:02.850 --> 09:05.820
Here you can see that the cell was run.

09:07.200 --> 09:11.380
Now, let us see a few more options which are present here.

09:12.420 --> 09:17.820
So the first option which I have is I can check if the mode in which a file is open.

09:18.300 --> 09:20.160
OK, so how we can do this?

09:20.160 --> 09:21.180
We would save print.

09:23.440 --> 09:28.270
And inside Prince, we will see which is the final object.

09:30.210 --> 09:37.050
And with defy logic, we use a lot of freedom and quality attribute, which is more.

09:38.220 --> 09:44.680
So each file object will have some functions and some attributes associated with it.

09:45.240 --> 09:48.590
So the flip side, which is associated is Cold War.

09:48.810 --> 09:51.420
And when I use this particular more.

09:52.930 --> 09:59.290
I can see the mode in which this is running, so let me do one thing, I need a screen here.

10:01.350 --> 10:07.310
I see mode, so this show me that this is the mode in which the file is running.

10:10.240 --> 10:20.500
Let me add a few more lines of code, so this is what the next what we have is readable so we can check

10:20.500 --> 10:24.310
if a file is readable in nature or not, so we can save the.

10:27.660 --> 10:29.680
And this is the function for the book.

10:30.060 --> 10:33.400
Similarly, when James is to read.

10:36.130 --> 10:37.520
Is readable.

10:38.180 --> 10:40.510
OK, next is.

10:44.580 --> 10:47.100
Will change this to Rightmove.

10:57.360 --> 10:59.970
And this would also change to.

11:03.020 --> 11:03.970
Right in the.

11:09.880 --> 11:14.650
So for now, let's run only this much and we'll run this.

11:16.630 --> 11:19.870
So this is giving an error that.

11:20.960 --> 11:24.200
We have this move, this is if not more.

11:34.010 --> 11:36.820
Read, this is read.

11:37.430 --> 11:38.730
Now let's run it again.

11:39.680 --> 11:42.250
So now you can see this is the output which we get.

11:42.740 --> 11:43.770
What is the output?

11:43.790 --> 11:51.560
It says the move is ah, that is the mode in which we open the file that we are opening the file in

11:51.560 --> 11:52.190
the read.

11:53.270 --> 11:56.140
Next, when we are opening the filing, read more.

11:56.170 --> 11:59.410
That means that this file should be readable in nature.

11:59.420 --> 12:00.750
I can easily read this.

12:01.340 --> 12:08.080
So for this it is showing for readability, showing on Sarastro and for you don't rideable.

12:08.090 --> 12:11.870
It is showing false, which means that I can override this file as of now.

12:13.510 --> 12:15.250
OK, now.

12:17.250 --> 12:23.150
Next thing what we can do is next, let us open this file in right now.

12:23.440 --> 12:25.960
OK, this we have seen for more.

12:26.310 --> 12:29.150
So now let's read this in a right more.

12:29.160 --> 12:31.350
So let me just copy this.

12:32.370 --> 12:34.890
And let me comment this also.

12:36.040 --> 12:40.020
So I just commend the South for this here.

12:45.560 --> 12:47.900
And I'll post it here again.

12:50.500 --> 12:53.700
And let me open this file in right now.

12:55.530 --> 13:03.390
So please know that this particular entire thing, this is a comment, this is basically a string,

13:03.390 --> 13:09.230
so it will act as a comment here so you can use this as a common goal.

13:09.660 --> 13:15.340
So when you will be running this particular find, what you can do is you can just remove these goods

13:15.840 --> 13:21.740
and it will change this into a comment on the comment so you can use it that way.

13:23.090 --> 13:26.250
So I'll open this in a right mood, I'm opening this fight in the right.

13:27.290 --> 13:35.000
So now what I'm trying to do here is when I'm opening this violent mood, I want to write something

13:35.000 --> 13:36.180
to this particular file.

13:36.210 --> 13:37.720
So let me write something.

13:38.270 --> 13:45.080
So let's see if you don't write this will actually write to my afine.

13:46.710 --> 13:50.530
So if you don't right, and inside this, what do I want, right?

13:50.550 --> 13:57.960
I want to write a the new line, so I use the passion for new life and I want to write.

13:59.250 --> 13:59.980
Hello.

14:00.880 --> 14:07.620
Well, that should be the first word, hello, world, and I want to give zation again so I won't be

14:07.620 --> 14:08.400
joining the line.

14:10.160 --> 14:11.960
So this is what we have here.

14:11.990 --> 14:15.260
OK, so now what I can do is I can simply run this.

14:16.440 --> 14:23.790
So when I ran this, it gives me the output that the final mode is like readability is false, right?

14:23.820 --> 14:24.540
Well, it's true.

14:24.570 --> 14:29.370
Now, let's go back to the file again and let's see what happened to a file.

14:30.270 --> 14:31.380
So this is a file.

14:32.430 --> 14:34.950
And I opened this file on.

14:37.370 --> 14:39.240
Nothing really happened to it.

14:40.920 --> 14:43.050
Let's go back and see what happened here.

14:43.560 --> 14:47.270
This is them on board the floor right now.

14:48.150 --> 14:52.490
We have written to this file, but we have not seen that changes.

14:52.500 --> 14:53.820
When will this change?

14:53.820 --> 14:56.560
We see when we close the fight.

14:56.670 --> 14:58.120
So we will close the final.

14:58.530 --> 15:03.730
OK, so we can see if you don't close, this will close my fight.

15:04.200 --> 15:06.040
So what we do, we open the fight.

15:06.070 --> 15:07.500
So what is the process?

15:07.830 --> 15:08.850
The process is.

15:12.480 --> 15:18.600
You will open a file that is the first step, second step, you will write in the file and third step

15:18.600 --> 15:19.710
you will close the fight.

15:20.220 --> 15:22.590
These are the three steps that you will be having.

15:23.470 --> 15:25.110
So let me run this now.

15:26.820 --> 15:34.410
And I'll go back, I'm here again, I will go to this, and now it is showing see, it is also showing

15:34.410 --> 15:38.420
the slashing that is next line, which I have given them.

15:39.000 --> 15:39.870
Now I bouba.

15:42.490 --> 15:44.710
So this is our fight.

15:45.070 --> 15:48.640
So now what we will do is we have returned to this fight.

15:48.850 --> 15:52.630
Now here I am able to write only one line now like this.

15:52.630 --> 15:54.370
I want to write multiple lines.

15:54.370 --> 15:58.240
What I can do is I can give more accurate, Heidi.

15:59.440 --> 16:02.410
This is Second-line.

16:07.510 --> 16:10.720
This is called lying.

16:12.150 --> 16:13.800
And I can run this.

16:15.810 --> 16:25.740
And I think that and this will run I go back to my demo when I close this and go back to this folder,

16:26.580 --> 16:30.160
and here you can see that the line has been updated.

16:30.870 --> 16:34.890
So what we have done is we have successfully written the word fight.

16:36.390 --> 16:40.830
They have successfully turned into a fire, but still there is something missing.

16:41.340 --> 16:46.110
I am able to write to my fire, but I'm able to write to that fire only once.

16:47.200 --> 16:50.170
If I tried to write on top of it again.

16:52.080 --> 16:56.750
See, we tried this again, I do another I tried.

17:00.270 --> 17:01.290
And I see.

17:05.990 --> 17:07.400
Hello again.

17:09.680 --> 17:12.680
And I did give us a potato here again.

17:13.980 --> 17:20.160
And you give a lot of thought and give us slashing, so this will show that I have changed the line

17:20.160 --> 17:23.430
again, so now I will again see a shift in the.

17:25.660 --> 17:27.550
And I go back to my follow.

17:28.600 --> 17:34.420
Inside with that, I go to them will one, and you can see that it has five.

17:35.570 --> 17:43.430
OK, so I can simply use the right function to write different lines of code to my vehicle.

17:43.920 --> 17:46.630
OK, now let's try some more thing.

17:48.360 --> 17:53.980
Now, let me go back now, I have done this, I have done this once.

17:54.240 --> 17:57.590
Now, if let me make some changes, OK?

17:59.100 --> 18:00.990
Now, after running this.

18:03.650 --> 18:05.590
Let me comment this out again.

18:07.960 --> 18:09.490
Let me get my daughter.

18:15.630 --> 18:16.050
OK.

18:19.250 --> 18:22.940
I open this file, I have done this illegally, Ecuador three.

18:25.100 --> 18:27.050
And I'll read something else here.

18:27.350 --> 18:29.500
So now this time, let's write.

18:32.460 --> 18:36.120
Adding new lines.

18:37.660 --> 18:41.620
So let us see, does it I've new line here to are all fine.

18:43.080 --> 18:53.130
So let's save this, let's run this and we go back, we go to this, and now what we have written earlier

18:53.130 --> 18:54.850
has completely gone away.

18:55.770 --> 18:57.630
So we have lost what we had.

18:57.630 --> 19:00.690
But again, so this is what right does.

19:01.290 --> 19:10.080
Right will allow you to make changes to the fight, but it will also override the fire when you know

19:10.080 --> 19:11.260
the same thing again.

19:11.940 --> 19:17.880
So if I want to write the will file again and again after one thread is closed, then what I will have

19:17.880 --> 19:25.500
to do is I even have to obtain the Google fight so I can operate on my file like this.

19:25.500 --> 19:29.190
I will have to open to my file to do it again and again.

19:30.110 --> 19:39.920
OK, so let us try to do that, but first, let's discuss about another concept which is presented by.

19:41.130 --> 19:44.610
So we closed this file again and we go back.

19:47.100 --> 19:49.350
So you can see that it has been defeated.

19:49.680 --> 19:53.220
Now let us see one more concept that would destroy planes.

19:53.700 --> 19:57.230
So we aim for the first function, which we have is right on.

19:57.330 --> 19:59.780
The function that we have is right lines.

20:01.090 --> 20:02.290
So let's get this.

20:05.610 --> 20:11.970
So what will happen, they will try to fight this, right will again try to define.

20:13.080 --> 20:16.200
Now, this is the next one, left and right lines.

20:19.900 --> 20:21.720
So now this will guidelines.

20:22.090 --> 20:28.210
So what I can do is I can add more detailed work, so there has to be an.

20:28.900 --> 20:30.460
So this is right lines.

20:32.950 --> 20:36.260
And I have a lot of data here, so let's see what happens now.

20:36.670 --> 20:38.560
And let me add another red line.

20:38.560 --> 20:40.730
So let me give the straight lines only.

20:43.100 --> 20:45.990
OK, and now let's run and see what happened.

20:46.070 --> 20:50.900
So I say control, as I say, finger to run this and I go back to.

20:51.930 --> 20:59.580
My file again, and you can see that it has done what I have instructed to do, I have got Diavik new

20:59.580 --> 21:03.330
lines, I've got the HelloWallet, I've got the next one.

21:03.870 --> 21:04.950
So I've got all the.

21:06.860 --> 21:08.840
Data, which I have, I did my flight.

21:10.140 --> 21:22.830
Now, let's go ahead and try to think on how we can I think from let us say we have some kind of a breather

21:22.890 --> 21:23.690
or legacy.

21:23.700 --> 21:27.120
We have some other stories point.

21:27.720 --> 21:32.460
We do not always have details given to it by the streams.

21:33.420 --> 21:39.010
We may have the day the in a particular list or some other data structure.

21:39.360 --> 21:42.060
So for that, we can use right lines.

21:43.360 --> 21:49.960
OK, so let us get this, so let me get my stuff if you don't open.

21:51.560 --> 21:53.540
And I know this.

21:54.700 --> 21:55.910
And I was.

21:57.220 --> 22:00.100
Go beyond a common diable one.

22:01.280 --> 22:03.260
And look and see if we're going to open.

22:07.390 --> 22:09.520
Now, this time, what I want to do is.

22:10.710 --> 22:13.650
I want to create something, so let's say my.

22:15.710 --> 22:16.370
Data.

22:17.950 --> 22:20.270
And in my data, I have.

22:20.290 --> 22:28.690
Let me give a list, so let's give a list of different strings so we can work this one, we need two

22:28.690 --> 22:29.620
different strings.

22:34.500 --> 22:36.000
So we have this.

22:37.730 --> 22:38.190
And.

22:40.010 --> 22:42.370
That's hippopotami here.

22:44.300 --> 22:45.680
Will my here?

22:48.110 --> 22:49.460
So we have one.

22:51.300 --> 22:51.720
Do.

22:52.740 --> 22:54.450
And three strings in this one.

22:56.090 --> 22:58.910
Now, latest news.

23:01.770 --> 23:06.330
Another thing, so let us use don't, right, straightforward.

23:09.070 --> 23:11.630
Let's see if we can do this with effort, all right.

23:14.570 --> 23:16.440
And we give my daughter.

23:20.410 --> 23:22.690
OK, and we are doing it for post.

23:27.400 --> 23:28.930
Now, I will run this.

23:30.190 --> 23:36.200
So here you get an error saying that the argument must be string model.

23:37.060 --> 23:43.720
So this means that when I use it for Lord right, it is expecting a string and it will not work on the

23:44.020 --> 23:44.560
list.

23:44.710 --> 23:47.040
So now let us try the same thing.

23:48.190 --> 23:51.340
With a four door, bright lights.

24:06.320 --> 24:08.510
OK, now let me run this.

24:11.480 --> 24:12.980
So let me get back.

24:14.560 --> 24:15.730
Openly one.

24:17.110 --> 24:21.700
And here you can see that it has taken the data from the list and did it way.

24:22.840 --> 24:29.230
So now you can you know, if you think that is the first thing that we have three modes, the first

24:29.230 --> 24:31.880
mode is read, then right then up.

24:31.900 --> 24:36.190
And we have two more modes that is read.

24:36.190 --> 24:37.270
Vanity, right.

24:37.270 --> 24:40.600
Vanity and the appen vanity.

24:40.780 --> 24:46.820
So these virginities ones, these are basically for some other data, talk to some of the fight.

24:47.470 --> 24:53.110
So in case you have to explain, you can simply use a read, write nothing.

24:53.410 --> 25:01.080
But in case you are working on some other file, you can you should use a right vanity and like a read

25:01.100 --> 25:01.560
binary.

25:01.690 --> 25:06.550
So instead of writing on, you will be writing or B the.

25:08.270 --> 25:11.250
So this is what we can do out of it.

25:11.570 --> 25:17.140
The next thing is let's use a law to write this.

25:17.330 --> 25:24.170
So what we can do is we can simply use a loop to write the data using the right option.

25:24.350 --> 25:27.320
So what we can do is instead of doing this entire thing.

25:35.390 --> 25:39.050
We can just do something like this.

25:42.670 --> 25:43.360
And.

25:44.630 --> 25:57.860
Instead of doing this, you can say you can get this, you can save for lying in my data.

26:02.590 --> 26:03.820
If all right.

26:05.090 --> 26:05.540
Nine.

26:08.150 --> 26:15.530
Now, what this does is it will be played on top of my data, the list, and it will write the data

26:15.530 --> 26:18.620
to my file line by line for them, one line by line.

26:19.050 --> 26:24.260
OK, so let me use if I do them so that you don't get confused which file we are writing.

26:24.260 --> 26:27.290
And also I just see this and run this.

26:27.650 --> 26:28.570
I get back.

26:28.700 --> 26:29.330
This is my.

26:29.780 --> 26:32.930
This is then what do I hear the data has been.

26:35.620 --> 26:38.950
Right now, the next thing which we have.

26:40.360 --> 26:50.260
Is the use of the Abang property, though, so a penguin just walking the same way.

26:50.590 --> 26:52.890
So let me get back here.

26:54.830 --> 26:55.910
Get this.

27:00.650 --> 27:01.970
Flows this.

27:06.110 --> 27:14.630
But this year and inside them, we'll go and change it to a fan and I'll add something more to it so

27:14.630 --> 27:17.600
that you'll get to know where we have changed.

27:18.140 --> 27:25.000
So I'll add one more string using a pen now.

27:25.700 --> 27:28.150
So this will show that we are using a pen here.

27:29.190 --> 27:30.500
So we are writing to it.

27:32.450 --> 27:35.900
And then just run this and I'll go back.

27:36.880 --> 27:38.170
This is my Nemoto.

27:39.590 --> 27:48.410
So you can see this, it has been delayed just along with it, so it has added the data to the file,

27:48.410 --> 27:50.040
which was already existing.

27:50.600 --> 27:53.380
Everything is remains just the same.

27:53.870 --> 27:54.890
You can use.

27:54.890 --> 28:02.220
Right, and write lines in the same way, the way we were using it with the like five.

28:05.380 --> 28:10.730
Now, below, what we have done is writing to a fire or a pending bullfight.

28:11.650 --> 28:17.350
Now, these are a few things which you will be doing once you have read the data, inworld on the data.

28:17.680 --> 28:21.160
So the very first thing that you will be doing is reading the fight.

28:21.490 --> 28:25.030
So let us see how we can actually read from the fight.

28:26.190 --> 28:36.360
So to read from a file, we have three functions, which will be the first function will be read next,

28:36.360 --> 28:41.070
will be read in line and the third one will be read the lines.

28:42.270 --> 28:48.020
OK, so this is the demo to files, and you can see this is the data which is already present here.

28:48.060 --> 28:49.830
I just put in a you.

28:51.400 --> 29:00.160
And I see this fight and I close this one, I go by and this is the actual base where I was.

29:00.970 --> 29:02.890
Now I coming this.

29:04.150 --> 29:09.520
Well, the people I know, again, I will read my later.

29:10.440 --> 29:17.160
So how can I be my little also for reading the dialogue to open the filing read, so I say.

29:19.040 --> 29:20.470
I don't need this now.

29:22.280 --> 29:23.660
So you get rid of this.

29:24.160 --> 29:26.340
Now I want to read the data.

29:26.780 --> 29:30.260
So what I will do is I get rid of this also for now.

29:32.320 --> 29:38.130
So we will simply read it for me and I will not give anything here.

29:39.460 --> 29:39.910
OK.

29:39.940 --> 29:41.140
And then I was losing.

29:42.440 --> 29:44.960
Now I want to bring those.

29:46.160 --> 29:52.550
So let me get this data into the data and I'll print data.

29:53.700 --> 29:55.380
Or let's bring in later.

29:56.370 --> 30:02.460
To show that we have the president after closing the files is going to bring.

30:03.860 --> 30:04.240
The.

30:06.020 --> 30:14.360
So now I run this CNN on this, you can see I was able to successfully lead the fight and now I have

30:14.360 --> 30:17.140
read all the lines in the Firebrace.

30:17.930 --> 30:24.110
Now, it is very convenient if I want to read all the lines of the data, but in case I don't want to

30:24.110 --> 30:30.980
read all of the lines, but only a few lines or only lines, one by one.

30:31.490 --> 30:35.960
In that case, what we can do is we can use the line.

30:36.050 --> 30:37.810
So let us see how we can do that.

30:38.510 --> 30:43.480
So I just coming this out again, I get this all.

30:46.900 --> 30:49.750
And let me tell you, the space and the.

30:53.520 --> 30:55.380
Based appeal now.

30:57.320 --> 30:57.980
We see.

31:01.030 --> 31:01.960
What do we want to do?

31:01.990 --> 31:03.850
We have open the file in the.

31:05.240 --> 31:09.770
Now, next, what we want to do is we want to read the lines of says simply.

31:10.880 --> 31:11.360
Ferenc.

31:14.880 --> 31:16.170
If you don't need.

31:20.960 --> 31:22.350
And get rid of this.

31:26.910 --> 31:28.020
Let me do this.

31:31.010 --> 31:32.240
Multiple times.

31:34.280 --> 31:36.740
OK, so let's run this.

31:38.650 --> 31:45.860
What this does is it basically got the data, so it read the first line.

31:45.880 --> 31:47.060
This is the first line.

31:47.890 --> 31:54.610
This is the same second line for line and footling it read all those things.

31:55.000 --> 31:59.740
So let me just point this out so that you will see what it has been doing.

32:00.550 --> 32:01.700
There is a.

32:03.250 --> 32:06.430
So here this is the blunt language is the first line is blan.

32:07.840 --> 32:10.950
This is the second and the fourth line, which is hello.

32:12.430 --> 32:15.940
This is the second, first and third line.

32:17.670 --> 32:21.510
And this is all four lines plus four lines.

32:22.800 --> 32:29.880
So you can read all the lines one by one like this, so if I keep adding this, it will probably print

32:29.880 --> 32:31.430
all the lines which are available.

32:31.650 --> 32:33.180
So it has done the same.

32:33.690 --> 32:39.600
OK, now let's say we have the leg exhaust, all the number of lines here.

32:41.290 --> 32:47.590
So I'm sure that my fire did not contain these many number of lines and none will run this again, so

32:47.650 --> 32:49.180
it gave me a blank space.

32:49.330 --> 32:53.820
So it will continue to read even though there is no legal presence.

32:54.430 --> 33:01.930
OK, so we need to have some mechanism by which we can stop it so you can basically check how many lines

33:01.930 --> 33:06.000
are present and then you can run this red line on top of.

33:07.650 --> 33:15.760
So a more convenient way would be what you can do is you can use read the lines.

33:16.410 --> 33:18.290
So what will read line do?

33:21.270 --> 33:30.660
Red line will again help you to read the details using the lines so I can simply say these lines and

33:30.660 --> 33:32.840
I can get rid of this entire thing.

33:34.890 --> 33:35.400
Lycan.

33:36.950 --> 33:42.590
Bring this so here you can see that it has read the line and it has also read.

33:44.220 --> 33:49.000
These datapoints, these next line present here.

33:49.500 --> 33:54.690
Now, one more thing to notice here is when we used Reline.

33:55.870 --> 33:57.600
It red line one by one.

33:58.990 --> 34:01.480
It rented one line, everything.

34:02.300 --> 34:10.450
And when you will read lines, it gave me back a list containing all the lines in separating this.

34:12.600 --> 34:16.000
So this is how we can actually get the number of lines.

34:16.200 --> 34:18.810
So what I can simply do is I can get Dehlin.

34:21.050 --> 34:22.190
Audrey realigns.

34:23.830 --> 34:29.020
And I have done this so you can see that there are global age lines and then I can read line or I can

34:30.310 --> 34:34.660
use this read lines and then get the data in to let us see.

34:36.560 --> 34:37.310
Data.

34:39.650 --> 34:44.650
And I'll get rid of this and then from Dubai, again, simply say bring.

34:46.810 --> 34:50.380
Data on the index see five.

34:51.250 --> 34:54.040
And this is one see?

34:55.060 --> 34:57.880
Eight is the eighth one.

34:57.910 --> 35:00.590
Now, this does not exist seven.

35:01.600 --> 35:02.900
It shows the seventh one.

35:03.160 --> 35:05.080
So this is how we can run this.

35:05.890 --> 35:11.290
OK, so this is all we can read and write data from a file and.

35:12.540 --> 35:14.230
Read the dull accordingly.

35:14.630 --> 35:22.200
OK, now one more thing, what we can do is we can use the for loop to read this particular date on

35:22.200 --> 35:24.510
weekends and use the.

35:26.390 --> 35:34.020
Makes sense for that, so we can simply say we can simply create a volume and we can use driveline.

35:39.620 --> 35:41.600
So what we can do is.

35:43.910 --> 35:45.470
We can simply say.

35:52.880 --> 35:53.660
For.

35:55.580 --> 36:01.780
You in range, say seven.

36:03.320 --> 36:04.510
I want to bring.

36:10.970 --> 36:13.650
And for the nine.

36:17.610 --> 36:21.650
And so it will be each and every line, one by one.

36:21.920 --> 36:32.070
So this is how you can easily read the files, you can easily read and write text files now how we can

36:32.330 --> 36:33.550
read and write.

36:34.010 --> 36:35.860
Oh, yes, we fight.

36:36.500 --> 36:40.420
So we will be using CSFI files very openly.

36:40.760 --> 36:43.970
Then we will be working with the delphiniums.

36:43.970 --> 36:48.990
So we will be reading files and writing files for the need of names itself.

36:49.010 --> 36:51.960
So let us go ahead and have a look at that as well.

36:54.920 --> 37:03.920
OK, to read and specify what we will be doing so we can do it very simplistic way, using the binders,

37:03.950 --> 37:07.460
libraries or what we will do is we will import Palm Desert Speedie.

37:08.660 --> 37:11.390
The next thing which we will be doing is we will be.

37:12.500 --> 37:19.190
Getting the part of the fight now, we already have a fight present at the store, so I will use the

37:19.190 --> 37:19.670
same.

37:21.420 --> 37:26.550
So I will use the same file from my desktop, so I give the part, so say.

37:27.630 --> 37:35.340
If that is equal to and if I fired you, so I will be giving the Viva.

37:36.610 --> 37:44.530
So my fight is residing at one mine next on Larry King Live divining, so let me see what the filename

37:44.530 --> 37:44.800
is.

37:45.460 --> 37:50.160
So the filename is by data, the CSP.

37:51.370 --> 37:53.050
Now, this is my filing now.

37:53.170 --> 37:58.570
How do I actually read from this, so I will be reading this file into a detail frame.

37:58.570 --> 38:05.770
So I said this is equal to 50 letters from the of Dot V.

38:07.130 --> 38:09.740
Underscore CSB now.

38:10.790 --> 38:14.990
There are several other file extensions also present.

38:15.320 --> 38:20.610
So for them, for all of them, there is a bond US function which will be available.

38:20.930 --> 38:25.440
You can go and search for based on which I would find that you have.

38:26.000 --> 38:27.350
So I have a reason.

38:27.380 --> 38:28.700
So I'm using CSFI.

38:28.700 --> 38:31.670
NTSB is the most mostly used one.

38:31.680 --> 38:34.090
So you will be facing kesby mostly.

38:34.400 --> 38:41.000
So I'm using the PSV and I give the ground races on inside this.

38:41.000 --> 38:41.750
I will give the.

38:41.960 --> 38:44.740
But so the effort.

38:46.090 --> 38:53.800
And along with it, I mean, we don't give a delimiter, so let me just do it this way and how I see

38:53.800 --> 38:56.070
the data is in India not.

38:57.510 --> 39:00.780
Hey, you see the little non-liquid on this.

39:02.140 --> 39:09.610
Now, here you see that the CSP file is having this single column and is giving me a single column,

39:09.610 --> 39:12.070
but I was not expecting to get a single column.

39:12.070 --> 39:19.100
I was actually expecting one, two, three, four columns which are separated by this fight.

39:19.870 --> 39:21.280
So what do I need?

39:21.460 --> 39:26.640
Give us a breather here, because these three fires usually have come as a separate.

39:26.860 --> 39:29.160
But this is an exception piece here.

39:29.230 --> 39:34.660
I have five thousand separate, so I will have to tell the finders.

39:34.660 --> 39:41.180
I believe that this is not a separate other SIPRI that is in the fire.

39:41.710 --> 39:50.080
So what I do is simply say Delimiter and I'll give the delimiter, which is the fire, and then I will

39:50.080 --> 39:50.780
run this again.

39:50.980 --> 39:54.490
So now it will understand that this is the.

39:55.470 --> 40:01.950
The Bible is there for them in two different columns and make this readable in nature.

40:02.760 --> 40:08.580
So this is actually how we will be creating our.

40:09.710 --> 40:14.050
Reading the CSB files and this is all you will read, any spoofy.

40:15.160 --> 40:17.080
Now, that is another thing, what you can do.

40:17.350 --> 40:19.450
You can also lead this fight.

40:19.600 --> 40:24.640
So let's say you have some data said you read the data, said you did your parents formations, and

40:24.640 --> 40:27.010
then you did a modern brain.

40:27.010 --> 40:33.080
The more the and you make some predictions, you made some predictions, and now you want to export

40:33.110 --> 40:35.570
those predictions into this week.

40:36.220 --> 40:37.520
So how would you do that?

40:37.990 --> 40:40.760
So for doing that, we have another function.

40:41.230 --> 40:42.530
So what does that function?

40:42.550 --> 40:43.780
The function is.

40:44.940 --> 40:45.480
And we'll see.

40:46.230 --> 40:54.570
So what we do, we will simply say the data of remains, will we say the door to see us?

40:55.470 --> 41:00.090
And we give the data from the name of the five to one.

41:00.450 --> 41:03.180
So let us say new.

41:04.250 --> 41:04.960
Fine.

41:05.900 --> 41:14.960
Thoughts and ideas run this night on this, I don't get anything, you know, I can simply go to the

41:14.970 --> 41:15.890
flowback.

41:15.890 --> 41:17.560
And this is my new FYI.

41:18.710 --> 41:20.570
And when I will open this.

41:27.000 --> 41:28.680
It will give the pilots it.

41:29.640 --> 41:35.670
So here you can see that this is the damage has been exposed, so you can easily see that the data has

41:35.670 --> 41:40.410
been exploded and the file the tab name has also been given us new.

41:41.520 --> 41:46.930
So this is a very simple example of how we can use kespin right ASV.

41:47.190 --> 41:50.040
Similarly, you can use any other function.

41:50.400 --> 41:55.490
For example, reading and writing, Excel file on file exemplify.

41:55.500 --> 41:57.690
You can write all of those very easily.

41:57.690 --> 41:59.480
Those filmi would be very simple.

41:59.490 --> 42:01.010
It's very similar to this one.

42:01.500 --> 42:02.610
So you can use that.

42:04.950 --> 42:12.670
So this is about reading and writing CSFI, in the next session, we will move towards learning about

42:12.720 --> 42:15.630
Binder's and how we can actually work with those.
