Okay, now the program is completed, let's execute this once again and see.
Right now you see packets in two packets and four packets in six packets in it.
And it is continuing.
While I want to close this, I use Ctrl C.
Okay, here is something.
I used Ctrl C and it is giving me this error.
Name of the error is called keyboard interact okay.
So.
It is good okay.
It's good for writing for programmers.
But for the user it's not very good.
Maybe user don't understand what is this means, but for the programmer it's good because they know
what is keyboard interact okay.
And also we can handle this okay.
Instead of showing a lot of things here, we could print a beautiful simple text that user simple user
understand Come back so we can do that by the name of.
We can do that by using something called exception handling.
Okay.
Here I will do that okay.
Here we are going to use try and accept.
Okay.
So let's use first try.
And hit tab.
Okay.
Now first it will come and try this one.
Okay.
If it is not this part okay.
The code is not belongs here.
Now we can change it to something else that is called accept.
Okay.
Now let's try that.
Except accept what?
Except name of the error that we had here.
Okay.
Keyboard interact.
That is here.
Name of the error.
And now, while it is into the accept part, I can print something.
Thing.
So let's print.
Detected control C.
Okay.
Detected control.
Or let's write this all in capital.
Control c.
And also quitting okay.
Now I think it is completed.
Now let's go back to terminal and execute this once again.
Okay.
It is sending all the packets.
Now I use control C now beautiful.
Let's say in detecting control C quitting.
And instead of having a very big and complex error here now I have a very readable text here that everyone
understand that.
Okay.
Thanks for watching.