WEBVTT

00:00.880 --> 00:01.240
Okay.

00:01.240 --> 00:06.240
Now let's continue and see how we can complete this.

00:06.280 --> 00:06.680
Okay.

00:07.240 --> 00:09.480
So here we are.

00:09.520 --> 00:11.800
We have done it just for interface.

00:11.840 --> 00:12.280
Okay.

00:12.600 --> 00:19.760
Now let's go and do this for uh other one which was Mac address.

00:20.200 --> 00:23.880
So parser dot add option.

00:24.400 --> 00:36.040
And here for Mac address I'm going to use dash M and it is going to be Dash dash Mac okay.

00:36.560 --> 00:40.600
And the value is going to be new Mac okay.

00:42.960 --> 00:43.280
Okay.

00:43.320 --> 00:44.360
How about help.

00:45.520 --> 00:48.520
The help is going to be equal to.

00:50.600 --> 00:52.680
Let's say new Mac address.

00:56.280 --> 00:56.720
Okay.

00:57.160 --> 00:58.120
Now it is done.

00:58.120 --> 01:00.800
And it is not yet completed okay.

01:01.160 --> 01:03.960
So as you see here, we have to think.

01:04.000 --> 01:04.400
Okay.

01:05.840 --> 01:06.640
Right here.

01:06.640 --> 01:08.560
You see, we have to think.

01:08.880 --> 01:10.520
And come on, let me show you.

01:11.600 --> 01:15.560
We have dash, let me clear this first.

01:18.080 --> 01:18.720
We have.

01:20.960 --> 01:21.320
Dash.

01:21.320 --> 01:22.680
Dash interface.

01:25.200 --> 01:27.400
Which is going to be ETA zero okay.

01:27.440 --> 01:36.440
And we have dash dash Mac which is going to be 0011 and 2233 and four four.

01:38.880 --> 01:40.680
Four four 4 or 5 five okay.

01:40.960 --> 01:42.080
So here you see two things.

01:42.080 --> 01:44.200
One of them is the interface.

01:44.200 --> 01:46.280
And then the value that we have here.

01:46.320 --> 01:46.760
Okay.

01:47.480 --> 01:49.600
So one of them is going to be the argument.

01:49.600 --> 01:52.480
The other one is going to be the option okay.

01:52.520 --> 01:54.800
So these are going to be the options.

01:54.800 --> 01:59.760
And these are going to be the interface and dash dash Mac are arguments.

01:59.840 --> 02:04.360
So we need to specify that right in here here Okay.

02:05.600 --> 02:11.360
And we need to store these, both these two things into two variable.

02:11.400 --> 02:11.800
Okay.

02:12.320 --> 02:13.520
So how can we do that.

02:13.680 --> 02:16.920
Let's create a tuple here.

02:17.320 --> 02:18.240
I'm going to name it.

02:18.280 --> 02:20.040
One of them is option.

02:20.040 --> 02:22.240
And the next one is going to be argument.

02:22.280 --> 02:23.040
Okay.

02:23.080 --> 02:27.320
So we never we're going to we never use argument okay.

02:27.360 --> 02:28.200
In our code.

02:28.680 --> 02:32.360
And we always use options.

02:32.680 --> 02:36.800
So we have option if you want to access the interface.

02:36.800 --> 02:42.160
So you need to use option dot dist which is the value anything you write here.

02:42.200 --> 02:42.360
Okay.

02:42.400 --> 02:48.640
For example option dot interface will give you the interface option dot new Mac will give you the new

02:48.640 --> 02:49.400
Mac address.

02:49.520 --> 02:51.200
Anything you write into this.

02:51.200 --> 02:52.000
This here.

02:52.040 --> 02:52.440
Okay.

02:53.560 --> 03:00.000
So here instead of giving these here I can use options.

03:00.280 --> 03:04.040
Dot what is this this interface okay.

03:04.080 --> 03:05.670
So let's use that interface.

03:06.470 --> 03:08.630
And also this one.

03:11.310 --> 03:15.070
Option dot new Mac.

03:15.870 --> 03:18.910
So now save it and let's go again.

03:20.630 --> 03:22.150
Let me see.

03:23.030 --> 03:26.190
Okay Dash I okay.

03:26.190 --> 03:29.550
Interface is going to be e th zero.

03:31.430 --> 03:38.910
And dash m which is Mac address is going to be 0011 and 223344.

03:39.150 --> 03:42.190
And we have for example seven seven.

03:42.190 --> 03:43.150
Now let's hit enter.

03:43.150 --> 03:46.390
And you see changing Mac address for it is zero.

03:46.390 --> 03:48.110
And this is going to be the Mac address.

03:48.750 --> 03:52.910
Let's uh use ifconfig and see if it is changed.

03:52.910 --> 03:54.190
Of course it is changed.

03:54.510 --> 04:03.270
Now this time I'm going to use dash dash Mac and dash dash interface okay.

04:06.190 --> 04:06.950
Interface.

04:07.510 --> 04:11.230
And let's change this to 99.

04:12.670 --> 04:15.990
And you see we have no error.

04:16.150 --> 04:17.790
And let's use ifconfig.

04:17.790 --> 04:21.830
You see that it is changed successfully.

04:22.110 --> 04:25.190
So now I think it is almost completed.

04:25.230 --> 04:25.950
Okay.

04:25.990 --> 04:28.950
The program and it is working perfect.

04:29.990 --> 04:33.510
And as you see the code is kind of missing.

04:33.550 --> 04:37.710
We could change this into a function because function is very good.

04:37.710 --> 04:39.790
Whenever we use it we call it.

04:40.870 --> 04:44.190
And if you need this in multiple times in multiple places.

04:44.190 --> 04:46.550
So you need to copy and paste the whole code.

04:47.150 --> 04:52.150
But if it is inside a function you only call the function.

04:52.190 --> 04:52.870
Okay.

04:52.910 --> 04:55.430
You just import the file just like this.

04:55.630 --> 04:57.750
And then you can use the function.

04:57.750 --> 04:59.150
That is very easy.

04:59.470 --> 05:07.390
So let's go and do something with creating function, putting all this stuff into functions and use

05:07.390 --> 05:07.710
it.
