[GUI Programming] EP6. Mortgage Calculator Program with Python & PyQt5 (Part 1)

Let’s make Mortgage Calculator for your home!

All right guys um today i think i was thinking what to build with the gui uh and i was looking up some easy example for you guys i decided to create a simple gui to calculate mortgage for the house i know a lot of people you know use the mortgage calculator on the online just you know type it in mortgage calculator on the google and you can easily find fun find

One on the online but we’re going to make one uh through the python as you guys know mortgage calculation including like uh that includes like compounding calculation and like it it relates a lot of calculation that you know mathematically and financially but we’re not gonna do that in here because we are not doing any mathematics class or financial class so

Here uh there’s one really interesting uh i can say like the library that you can reference so first go on to your cmd here and then do pick install more if you do this uh well for me i already downloaded on my computer so uh if you guys haven’t then you will download this and then after that you can just import the mortgage one yeah from mortgage okay so

I hope you guys follow this far um here so this is the mortgage library that we are referring to and then what this does amazingly uh let’s say say loan equals to uh and then principals principal is the money that you’re borrowing from the bank so we’ll say like you know all right this 300 000 and then interest i’ll say you know six percent right uh that that’s

Really high but so we’re gonna say six percent uh and the term uh term in here is by the year so uh you have to choose like how many years usually like 30 years right and then here we’re going to print the loan here that we defined here with principal interest and terms that summarize see so as you guys can see this gives us the summary of what original balance is

Like interest rate uh and apy uh apr terms uh and the monthly payments everything however this is just um the summary of it and then this is not structured by array or the list so you cannot really do like you cannot really do this okay but uh what this has is one by one so let’s say loan dot um monthly payment so you guys see so it will just print out the amount

See also  Vietnam Valuations Look Reasonable: Ho Chi Minh City Securities

Of monthly payment so with this function we’re going to create a gui to calculate so there is going to be input parts like uh principles interest terms or something else i’m gonna i’m thinking of putting in like a down payment so you can calculate it and then each part the result here that we had like uh with this summary uh we’re gonna put each result into

The line edit boxes so we can see from the gui okay so all right let’s start up our pi cube here one second all right so i’m gonna choose dialog without buttons all right here we are all right so we got this first uh we’re gonna need the total price of the house right so i’m just gonna count let’s count it here one second so let’s see what we need so we’re gonna

Need one two three these three and i’m gonna put it in uh like a down payment part so like one two three four for the inputs and uh the output part should be i don’t think we should like display these things because these are already the thing that we put it in here so you guys should know or the user should know um so what we’re gonna put is uh monthly payment

Total principled payments like total interest payments total payments interest to principal and i guess here to pay you to pay i don’t think we need this as well so we need one two three four five outputs and then one two three four inputs right all right so we’re gonna need total of uh nine nine line added right so line edit here one two three four inputs and

One so principal balance apr uh ap apy uh yeah let’s do let’s put principal balance because we’re gonna need it after calculation of down payment uh so actually six output one two three four five six correct all right let’s do this and then we’re gonna label each of them first let’s put the title here then just drag and drop okay and then uh we’re gonna need

See also  How Does Whatsapp Make Money? Make Money Online With Whatsapp

The push button to calculate here so this one we’re going to label as mortgage payment car later right all right first one will be uh like total price correct second one uh down payment and third one interest rate first one will be term how long you’ll be learning the money and then the first output should be principal balance like this will be basically the

Total price minus minus down pin right so you guys can see better um principal balance and this one will be say apr and apy monthly payment total price uh the principal uh total principal payment payment um in interest for interest what was it keep forgetting okay let’s do this in first payment i think we are missing some all right let’s make some more and

Then we use the total payment and the interest to principal right so this should be good payment and this should be interesting right i can’t really see what this is each okay we’re going to create the layout of each one so you don’t really have to line up right now if you guys have you know seen my lesson uh from the last video so and then let’s put some i

Guess the unit so label the total uh price will be what the dollar right dollar so this will be dollar two and like this interest rate this should be percentage and then term should be it could be months or in a year uh well the in the software i mean in the programming that the library that we are referring to is going by i think the year but we can also

Set to the month so all right let’s give these options so this is a combo box here that we didn’t use before so we just drag it and then if you double click it you can actually create the item that goes in here uh one will be month years so you guys can now see like there’s a combo box drop down menu here this will be let’s say cartoon late principal balance

See also  Destroy Everything With These Top 5 Best Yelan Teams | Genshin Impact 2.7

Should be not percent well apr and apy should be percentage is there any other percentage here total payment is this one should be percentage see principal balance here monthly payment principal payment through interest payment uh and total payment right all right we got everything right right uh okay so uh like we did last time we’re going to create each

One’s layout so here actually so just click three of them that lines up uh vertically and then you i mean horizontally you just click those three and then click this layout horizontally buttons and then you know you don’t really have to line it up manually correct so you just do that for all of them it’s taking some time all right all right uh after you’re

Done with this uh we’re gonna line this like create the layout like vertically so you just click each layout make sure you don’t just click on it like uh the component of each layer you have to make sure that you completely selected the whole layer okay so just you know point out the mouse well on the layout that you created and then this whole thing will be

Lined up vertically so we just click here lay up vertically all right so this is nice and clean right we’re gonna adjust the size a little bit and yeah let’s let me save it lesson two okay and then lastly you wanna like click on the background here and where is it layout layout in a grid so we learned the difference between those two if i don’t do this like the

Some part will disappear if i you know shrink the window but then uh here if i lay out in a grid it will not it will and then it also will increase the size depending on the window size okay all right uh we created gui today uh next time we actually gonna implement this functions each one’s functions okay all right then just leave me a comment if you have any

Questions and we’ll see you guys next time

Transcribed from video
[GUI Programming] EP6. Mortgage Calculator Program with Python & PyQt5 (Part 1) By SsupProgramming