In one of the lecture we covered Python in Python basics.
Okay, we covered Python variables okay.
So here I'm going to show you how you can use variables okay.
We need to use variables in here.
As you see we have few things here that is necessary to put them into store them into variables.
One of them is interface.
The other one is Mac address.
Okay.
So let's do this.
Let's create a variable name it interface.
So this interface is equal to something right now.
You see it is it is zero okay.
Later you can change it.
And also we have new Mac address.
So it is equal to this thing right now.
And that could be changed too.
So let's add this from here okay.
Use control X and use it here control V.
And then use your new Mac here okay.
Right here.
Or maybe not there.
Here, use a plus.
And then your new Mac address.
Okay.
Now we have the new Mac address here.
And it is time to use the interface variable.
Okay.
So the interface here we say for which it is zero if you're using LAN.
So LAN zero.
And here we need to use interface.
Okay.
Enter is and concatenate that with this one.
Okay.
Not really.
Down
here we have something.
Okay.
That is here.
Okay.
Good.
Now we have interface right here.
That is that we are using interface here.
Be careful about these spaces here needs to be here okay.
And also let's uh copy this part okay.
Use Ctrl C to copy that and then just paste instead of E to zero and eth zero okay.
Now we have a program that is looks a little better than that okay.
Now again let me save this.
This time I'm going to change it to for example six six okay.
Save it and let's move to terminal I have opened the terminal right here okay.
Let me use ifconfig.
Now you see that the the Mac address it is five five okay.
And let me use Python.
We have mac changer.py hit enter.
And again.
Also let's add more thing like print.
Use a print statement.
Okay, I will do that.
But before that let me see that if it is changed, of course it is changed.
Okay.
Here, right in here.
Let's print a statement like changing a mac address for for this interface to this Mac address.
Okay.
Can we do that.
Yes, we can do that okay.
We are a programmer.
So we are able to do anything we want okay.
And here I'm going to changing tell changing.
Mac address.
To okay.
Or we could use for.
For what for interface.
So we are using interface here.
And then concatenating this with.
This one.
It is going to be new Mac address.
Now let's see, how does it look like?
Okay.
Save it.
Come to terminal and clear this.
Okay.
Or let's change this at seven seven.
So okay.
Save it.
And here.
Use ipconfig right.
Then you see it is six six.
And it is telling you that changing Mac address for eth0 to this one okay.
And now let's see if it is changed or not.
You see that it is changed to seven seven.
Very good.
Here you'll learn how to use variables.
Okay.
So good.
Thanks for watching and I will see you in the next lecture.