Okay, now the program is working like this.
Okay.
And as you see it is printing each character, uh, separately.
And if you want to handle that here, um, beside these, uh, key, while you're printing the key,
you can use another thing that is called dot pad.
Okay.
Now, if I come back here, let me just ctrl c and, uh, clear this.
Now, here, if I try to add something like this is when I hit space, it gives me an error.
Okay.
But the good news, it has a very good part.
Okay.
See?
Now, for example, I write this again.
Hit space.
It gives me an error.
And that is attribute error.
And it is telling me that key object has no attribute.
C h a r.
Because it is a space.
Okay, so we can handle that by using this one.
Try an exception.
Exception okay.
Try except let me copy this.
Okay.
Here we have it.
Here.
Let's use try.
Okay.
And try will come and check if it has a character.
So it will lock the character.
If not.
So we will go to exit.
Except.
This one.
Okay.
Which is an attribute error.
Then we can print the lock.
Okay.
We can print the lock or we can do a lot of more stuff.
Thing.
Let's see once again.
Okay.
Let's use this.
Space.
Is space.
Okay.
Something like this.
And let me come back here into my editor.
So right now it is only printing the log in, except it is printing the log in Troy.
It is not printing the log.
But no problem.
We can handle that too.
We have an option here.
Let's use if condition here.
If this key is equal to key dot space, let's do one thing.
If it is a space, then I want to add a space instead of having that key space.
Okay.
Let me.
Okay.
Like this.
Now.
Uh, I can log this here.
Like this log is equal to log class space.
It is the if part.
And also we have the else part.
Else part is log is equal to log class.
Let's add a space again here.
This time I'm adding a something like special characters like uh special keyword.
So I can use that okay.
With a space.
And then we need to concatenate this.
Okay.
Also a space is here.
Now we have this all here.
As you see, we are not printing anything at all.
Let me come right in here and then print the lock.
Okay.
Save this.
And now let's come back here and see what is going to happen.
This is Ctrl c it clear.
And okay.
Now it is executed.
Let's say.
Let's hit start space.
See if I hit backspace.
Okay.
It is adding backspace.
Let me do one thing.
Use Ctrl C here.
And like this.
Clear this.
Okay.
Execute this.
But again now I'm going to say this.
Okay.
Is there is, for example, hello world from me.
Hit enter.
Now you see that this is the text that the user typed.
And you see, while we are pressing, while we are pressing this space it is adding a space here.
Okay.
And while we are hitting other keys like Enter or Alt Shift Capslock anything, it will add that here.
Okay.
Let's see.
I hit ctrl C.
It is key control.
For example I'm hitting shift Z it is shift.
I hit Capslock.
It is Capslock.
Okay.
So now our program is working.
The only thing which is not completed is to send it or to report this okay, into an email server or
something.
Let's do that here.