WEBVTT

00:00.440 --> 00:00.680
Okay.

00:00.720 --> 00:05.000
In the previous lecture we were we were able to do this part.

00:05.040 --> 00:05.440
Okay.

00:06.280 --> 00:11.440
Uh, it looks like actually the user is typing something not like this.

00:11.480 --> 00:13.960
Like we have a command keyword here.

00:13.960 --> 00:18.120
We have, uh, quotation marks, and here we don't have it.

00:18.120 --> 00:18.880
Okay.

00:18.920 --> 00:20.160
So it looks better.

00:20.560 --> 00:24.800
Now it's time to go for something else.

00:24.800 --> 00:29.440
And that is reporting in the reporting part we are going to use uh, one more thing.

00:29.440 --> 00:32.040
And that is called threading okay.

00:32.080 --> 00:35.440
So here I'm going to remove this and log from here.

00:35.440 --> 00:38.720
And then I'm collapsing this function.

00:38.720 --> 00:41.000
And here I'm going to import.

00:44.920 --> 00:45.560
Come on.

00:49.840 --> 00:50.760
And.

00:54.320 --> 00:55.000
I got.

00:57.280 --> 00:57.640
Okay.

01:00.800 --> 01:02.600
Import feeding.

01:02.640 --> 01:03.040
Okay.

01:06.760 --> 01:07.680
Import threading.

01:07.760 --> 01:14.560
And now here let's create a function I'm going to name it I don't know.

01:14.600 --> 01:15.120
Let's go.

01:15.160 --> 01:16.720
Name it report.

01:17.400 --> 01:19.280
You can name it anything you want.

01:19.320 --> 01:21.040
It is going to be a recursive function.

01:21.040 --> 01:22.400
What is a recursive function.

01:22.400 --> 01:29.800
Whenever you are calling a function from inside of that function, that is called recursive.

01:29.840 --> 01:32.800
For example here if I use report.

01:36.800 --> 01:37.560
Report.

01:37.560 --> 01:45.120
So right now it is a recursive function because I'm calling this function from inside of this function

01:45.120 --> 01:46.200
okay.

01:46.240 --> 01:48.440
This is called recursive.

01:48.600 --> 01:52.000
So here we are going to use that log again.

01:52.160 --> 01:55.400
So I'm going to use global log okay.

01:57.560 --> 01:59.920
And let's print the log.

02:02.490 --> 02:03.370
And also.

02:06.050 --> 02:12.570
Uh, log is going to be equal to something like an empty string.

02:12.730 --> 02:13.090
Okay.

02:14.490 --> 02:16.570
Then we need to create a timer.

02:16.690 --> 02:22.250
So this timer is going to be equal to reading dot.

02:22.930 --> 02:25.290
Here we have a timer.

02:25.290 --> 02:26.930
So we need to give a time to this.

02:26.930 --> 02:30.010
For example right now you can give any time.

02:30.050 --> 02:30.250
Okay.

02:30.250 --> 02:35.450
For example I'm going to give this at least six seconds because I'm testing this.

02:35.450 --> 02:39.370
And then I need to call the function f function any function here.

02:40.010 --> 02:45.530
And you know that we are going to call the report function because it is going to be a recursive function.

02:46.130 --> 02:51.530
So report function and you don't need to give this parenthesis here.

02:51.570 --> 02:51.930
Okay.

02:52.490 --> 02:56.530
Now I did called the report function and I did.

02:56.570 --> 02:58.530
And I do have the timer.

02:58.570 --> 03:00.850
Now it is time to start the timer.

03:00.890 --> 03:01.250
Okay.

03:01.650 --> 03:04.530
So we use timer dot start.

03:06.050 --> 03:08.250
And this start is a function.

03:08.810 --> 03:09.610
Okay.

03:09.610 --> 03:14.010
And the next thing is to use this report function right here.

03:14.050 --> 03:15.250
Okay.

03:15.290 --> 03:17.890
You need to use this report function.

03:18.450 --> 03:24.450
Call this report function before you start this report listener.

03:24.490 --> 03:28.850
So let's use report here.

03:28.890 --> 03:30.450
Now I'm saving this.

03:30.770 --> 03:31.770
Let's go back here.

03:32.330 --> 03:34.010
And let's clear this.

03:35.130 --> 03:37.530
And also this.

03:38.970 --> 03:40.050
Let's execute this.

03:42.610 --> 03:42.970
Okay.

03:42.970 --> 03:45.450
Let's say load.

03:45.450 --> 03:46.810
This is me.

03:47.930 --> 03:53.290
See after six seconds you see that we are having this one again.

03:53.290 --> 03:59.100
If you print nothing, if you type nothing again it's going to print you an empty terminal or an Going

03:59.100 --> 04:00.900
to text here.

04:00.940 --> 04:01.380
Okay.

04:01.420 --> 04:06.420
After six seconds again I'm going to say hello.

04:06.460 --> 04:09.420
My name is in.

04:10.700 --> 04:11.740
So just a moment.

04:11.940 --> 04:12.380
Hello.

04:12.420 --> 04:13.900
My name is in.

04:13.900 --> 04:18.300
So after six seconds this will be reported.

04:18.340 --> 04:18.940
Okay.

04:18.980 --> 04:24.940
Now it it looks better now if I hit the enter or enter.

04:24.940 --> 04:27.700
So you see the enter the enter key.

04:27.700 --> 04:29.660
Enter key after six second.

04:29.700 --> 04:30.460
Okay.

04:30.460 --> 04:31.860
You can give more time.

04:31.860 --> 04:38.860
For example you can you want to report this at least each hour.

04:38.860 --> 04:43.620
So you can give uh, something like this okay.

04:44.620 --> 04:47.660
And you will be good to go.

04:48.220 --> 04:52.580
So now I'm going to leave this to be at least six second.

04:52.580 --> 04:54.780
And right now it is working for me.

04:55.060 --> 04:55.420
Okay.

04:56.100 --> 04:59.180
Let's go and see how we can improve this better.
