Hello and welcome to part three of creatine.
Hey count down timer with Python.
So we are now going to set the end date when we want the our event to end.
So we're not going to set up the end date so we can start counting the time.
So we created a global variable here caught in time so I'm going to use that now.
So I'll say and Ty
I'm going to set that to equal to the date time
dot the date
time method.
And inside that method inside in between the parent this is for this method is where I will specify
when I want my event to hit.
So you start with the year 2017 followed by the month is the ninth month followed by when I'm wanting
to and I want it to end at the end of this month.
I'll say it 38.
OK.
And then you pass him zero just to formatted and 0.
So if you have a mom that doesn't end in 31 days 30 for example if you pull 31 and you know that September
only has 30 days it hold true up an error.
So this here the first zero will represent the hours and the second zero will represent the minutes.
So now we've set a value for our time variable here which is going to equals to be the date time inside
the daytime module.
We have a method called date time and we pass passing it the value of the year the month the date and
then the time.
This for zero will represent the hours and seconds.
And the other one represents the sorry the first zero represent the hours and the minutes and the other
zero represent these seconds we imported the font from tick into.
So let's try and use stats as well.
So to use that we are going to create a variable here.
I'm going to create a variable called half empty which is short for font you could call anything doesn't
matter.
We're going to send that to font dot font
and the inside the parentheses
of this font method.
We are going to pass in several properties.
First we want to pass in a font family.
We are going to passing a font called Helvetica.
Hell of a car OK.
And next saying we want to do we want to give the fantasize so I'm going to set this to say what shall
I give I'm going to make this 90
and I want it to be bold so I say wait equals bold weight means how thick you want it to be outside
just send it to bold Whoops I've got my it's my quote aren't side a parentheses it should be inside
to save time I have completed the rest of the code here.
So we've already covered this one.
This is way high set the new variable for the font and the past in days values is here.
This will be responsible for the size of the clock of the tick.
Okay.
Nothing at all.
Not will control the size of the text on the screen here defined a variable or text.
When you define a variable you can always change the values so this variable here I've set it to equal
to a string var or that means is that this will accept string values.
So the values that will be passed into this variable is going to be string.
And here we go and label him using the T T K module.
This one here and the label and musing here for the label which is the root which is that is the root
of the application.
I am certain it takes variable to close a text set in the font to cause to this font here the variable
the foreground color which would be the color not the background color the color the front will be white
the background would be blank.
And here this here is used to position the clock on the screen.
This uncle here positions it in the center.
And this too here really relax and rewire her use to position the X on the y axis.
And then here we've got the route the main loop.
So this keeps the application running.
So this is what keeps the clock running until you exit it.
So it handles the event loop.
Okay.
So each time the event loops it handles it and it keeps the application running on till the window is
closed.
And when the windows closes usually cause the quit function here and then exits the application.
So that should be it.
So I'm just going to save this.
Make sure that you format your code just like I have if not the editor here will complain is is very
fuzzy.
He likes it's code to be formatted in a setting way so if he complains just respond by formatting the
code properly.
So this is it.
So I'm going to test to run the application so I'm going to click Run module.
Okay.
That is it.
So it tells me I have 22 days left 22 days seven hours 58 minutes and 53 seconds left to my event.
So you can always change the value of when you want a event to end.
So that's it.
You create a countdown time in Python.
Thanks for watching.
Bye for now.