WEBVTT

00:00.920 --> 00:03.440
Okay, now the program is working like this.

00:03.440 --> 00:03.840
Okay.

00:04.440 --> 00:08.920
And as you see it is printing each character, uh, separately.

00:09.320 --> 00:18.200
And if you want to handle that here, um, beside these, uh, key, while you're printing the key,

00:18.480 --> 00:23.160
you can use another thing that is called dot pad.

00:23.200 --> 00:23.640
Okay.

00:25.720 --> 00:32.360
Now, if I come back here, let me just ctrl c and, uh, clear this.

00:34.720 --> 00:43.440
Now, here, if I try to add something like this is when I hit space, it gives me an error.

00:43.480 --> 00:43.960
Okay.

00:44.240 --> 00:48.120
But the good news, it has a very good part.

00:48.160 --> 00:48.960
Okay.

00:49.000 --> 00:49.360
See?

00:51.520 --> 00:54.160
Now, for example, I write this again.

00:54.200 --> 00:55.000
Hit space.

00:55.160 --> 00:56.400
It gives me an error.

00:56.400 --> 00:58.560
And that is attribute error.

00:58.960 --> 01:02.020
And it is telling me that key object has no attribute.

01:02.060 --> 01:03.940
C h a r.

01:03.980 --> 01:05.460
Because it is a space.

01:05.900 --> 01:09.300
Okay, so we can handle that by using this one.

01:09.300 --> 01:10.300
Try an exception.

01:10.340 --> 01:11.260
Exception okay.

01:11.300 --> 01:13.540
Try except let me copy this.

01:16.500 --> 01:16.740
Okay.

01:16.780 --> 01:17.940
Here we have it.

01:20.780 --> 01:21.260
Here.

01:23.380 --> 01:24.500
Let's use try.

01:24.540 --> 01:24.940
Okay.

01:29.900 --> 01:34.180
And try will come and check if it has a character.

01:34.180 --> 01:36.540
So it will lock the character.

01:37.260 --> 01:38.260
If not.

01:38.380 --> 01:40.100
So we will go to exit.

01:40.820 --> 01:41.540
Except.

01:45.020 --> 01:45.580
This one.

01:45.580 --> 01:45.820
Okay.

01:45.860 --> 01:47.540
Which is an attribute error.

01:47.980 --> 01:49.980
Then we can print the lock.

01:50.420 --> 01:50.820
Okay.

01:52.180 --> 01:57.980
We can print the lock or we can do a lot of more stuff.

01:58.020 --> 01:58.500
Thing.

01:59.740 --> 02:01.070
Let's see once again.

02:07.510 --> 02:08.950
Okay.

02:08.950 --> 02:10.910
Let's use this.

02:14.230 --> 02:14.870
Space.

02:15.630 --> 02:17.510
Is space.

02:20.750 --> 02:21.230
Okay.

02:21.270 --> 02:22.230
Something like this.

02:25.030 --> 02:28.950
And let me come back here into my editor.

02:29.310 --> 02:34.670
So right now it is only printing the log in, except it is printing the log in Troy.

02:34.670 --> 02:36.230
It is not printing the log.

02:37.430 --> 02:38.670
But no problem.

02:38.830 --> 02:41.990
We can handle that too.

02:42.230 --> 02:44.990
We have an option here.

02:47.630 --> 02:49.310
Let's use if condition here.

02:49.310 --> 02:56.710
If this key is equal to key dot space, let's do one thing.

02:56.710 --> 03:02.290
If it is a space, then I want to add a space instead of having that key space.

03:02.330 --> 03:02.690
Okay.

03:03.850 --> 03:04.490
Let me.

03:05.690 --> 03:06.010
Okay.

03:06.050 --> 03:06.650
Like this.

03:07.890 --> 03:08.330
Now.

03:11.330 --> 03:14.050
Uh, I can log this here.

03:14.050 --> 03:20.690
Like this log is equal to log class space.

03:25.850 --> 03:26.810
It is the if part.

03:26.850 --> 03:28.970
And also we have the else part.

03:29.010 --> 03:33.370
Else part is log is equal to log class.

03:34.170 --> 03:35.890
Let's add a space again here.

03:36.170 --> 03:44.490
This time I'm adding a something like special characters like uh special keyword.

03:44.490 --> 03:48.290
So I can use that okay.

03:48.330 --> 03:49.850
With a space.

03:51.370 --> 03:55.210
And then we need to concatenate this.

03:55.410 --> 03:55.810
Okay.

03:57.450 --> 04:00.790
Also a space is here.

04:03.870 --> 04:05.670
Now we have this all here.

04:05.670 --> 04:08.670
As you see, we are not printing anything at all.

04:08.870 --> 04:12.230
Let me come right in here and then print the lock.

04:12.270 --> 04:12.670
Okay.

04:15.110 --> 04:15.750
Save this.

04:15.750 --> 04:19.350
And now let's come back here and see what is going to happen.

04:19.430 --> 04:22.270
This is Ctrl c it clear.

04:24.630 --> 04:27.110
And okay.

04:27.150 --> 04:28.430
Now it is executed.

04:29.270 --> 04:29.910
Let's say.

04:33.230 --> 04:35.150
Let's hit start space.

04:37.470 --> 04:41.550
See if I hit backspace.

04:42.030 --> 04:42.230
Okay.

04:42.270 --> 04:43.910
It is adding backspace.

04:44.510 --> 04:46.910
Let me do one thing.

04:46.950 --> 04:48.110
Use Ctrl C here.

04:49.310 --> 04:52.310
And like this.

04:53.870 --> 04:56.550
Clear this.

04:56.590 --> 04:56.830
Okay.

04:56.870 --> 04:57.510
Execute this.

04:57.510 --> 05:00.600
But again now I'm going to say this.

05:01.560 --> 05:01.960
Okay.

05:03.080 --> 05:09.440
Is there is, for example, hello world from me.

05:11.320 --> 05:12.040
Hit enter.

05:13.440 --> 05:17.920
Now you see that this is the text that the user typed.

05:18.000 --> 05:24.360
And you see, while we are pressing, while we are pressing this space it is adding a space here.

05:24.400 --> 05:24.840
Okay.

05:25.600 --> 05:35.560
And while we are hitting other keys like Enter or Alt Shift Capslock anything, it will add that here.

05:35.600 --> 05:36.040
Okay.

05:36.760 --> 05:37.560
Let's see.

05:37.680 --> 05:39.440
I hit ctrl C.

05:39.480 --> 05:40.520
It is key control.

05:40.520 --> 05:44.240
For example I'm hitting shift Z it is shift.

05:44.280 --> 05:45.640
I hit Capslock.

05:46.080 --> 05:47.360
It is Capslock.

05:47.400 --> 05:47.760
Okay.

05:48.200 --> 05:50.040
So now our program is working.

05:50.040 --> 05:56.880
The only thing which is not completed is to send it or to report this okay, into an email server or

05:56.880 --> 05:57.440
something.

05:57.960 --> 05:59.840
Let's do that here.
