Hello and welcome.
We are going to be creating a wheat conversion tool that will convert the feet to meters.
This is going to be a three part video project so we'll start in part 1.
It's always a good idea to try and design or sketch out what you want your application to look like
before you actually go ahead and build it.
So this is a rough sketch I've made.
So the application is going to have a title which is going to say feet or meters it's going to have
an input box where you enter the value in feet and then you press calculate button it would display
the equivalent in meters.
So I will be using the python Idol for this project.
So to access the idol you click on your programs menu wherever your pipe on folder is you click on it
and double click on the Python idol.
And that would give you access to the shell.
Once you've got the shell open we need to open a new file click click on new file.
So this file here is where we'll create our project all the code will write or write it inside here.
So the first thing to do is to save this file as a python file so you do save as it already knows it's
going to be a python file so we just need to give it a name.
So I'm going to call it F 2 meters.
So feel free to call yours wherever you like and and save it in whatever location you want.
I'm going to click on desktop and save mine to the desktop.
So anything I create here now would become a python python file for this project.
I want to use a couple of Python modules.
So before you can use the modules in Python you have to import them.
So I'm going to import it using the word from space followed by the name of the module is called T counter
space followed by the word import space and then Asterix and the second module I'm going to import is
called T Kent as well so take into space import space t t k so these two lines basically tells Python
that our program needs these two modules.
The first module is called take into this is the standard binding to Tiki which when load it also causes
the existing T.K. library on your system to be loaded.
So if you've got two kids on your system of course need to be loaded.
The second module which is K is Python binding to the new are themed widgets that were added in TKD
version eight point five.
So the difference between the two is that with the teak into the first one you can configure the widgets
you know almost as you like.
Whereas the second one the TDK is more locked down but it's more professional.
OK.
So if you don't want if you want a professional looking widget or theme and you don't want to configure
it much then Titi case your option but if you want to have total control then use the widgets within
the tea counter module.
Notice that we've imported everything from the teak into our module so so that we can call the T counter
functions and every other thing that relating to that module so you can call them without prefix in
them.
OK.
Which is the standard t keen to practice however because we've imported TDK itself.
That means we'll need to prefix anything inside that t t care module.
So if we're using like an entry entry module really we need to specify that.
So if the entry entry we get is a t t k 1.
So you need to specify Tiki dot entry you need that in order to invoke the function inside the T T K
module.
Sometimes you need both modules.
Other times you need just the one depending on the context to save time.
I've added some lines of code here.
Okay so I've added these lines of code here.
We've got the root cause to T.K..
Basically what we're doing here we are setting up the main window for the application.
And here the root not title we've given it a title with calling it feet to meet.
So this will be the title for the application and then created a frame we get.
Okay.
This is a frame widget which will hold all the content of our user interface and also police will pleased
that inside the main window we defined the main window here.
So this frame will be placed inside the main window.
This bit here the column configure this be here.
What that what that does.
It tells Tiki that if the main window is resized the frame should expand to take up the extra space.
OK.
That's what this line does.
Rule number go row here.
The the rule configured.
Basically what that will do it will configure the row so the random number basically is the rule into
which you want to insert your which and the default counting starts from zero.
So the default is in the next higher and higher value for the.
On occupied rope.
Notice we've got
the sticky option here.
This sticky here.
Basically this option determines how to distribute in the extra space within the cell.
That is not taken up by the widget.
If you do not provide a sticky attribute their deferred default behavior basically will is to center
the widget in the cell.
You can position the widget in a corner of the cell by using the sticky word and he has certain values
so these values refers to the way you can stick make the widget stick in the cell and W refers to refers
to not from bottom to left.
OK so if you're doing w sorry it's top left and W refers to top left you want it to be position on top
left and then e e refers to e will be the right center and then it will stretch the widget in a vertical
position so that's what these values are.
They are geometric values and these values are all part of the agreed method.
So I'm going to end this lecture here and we will carry on in part 2.
So say in part 2.
Thanks for watching.