Thứ Hai, 1 tháng 1, 2018

News on Youtube Jan 1 2018

easy kolam

For more infomation >> easy rangoli for sankranthi | easy and simple kolam designs | latest sankranti new muggulu 2018 - Duration: 1:30.

-------------------------------------------

The science is in: Losing Weight May Be As Simple As Standing Up - Duration: 3:05.

New Science Shows Losing Weight May Be As Simple As Standing Up.

By now you've probably heard the notion that "sitting is the new smoking" or put even more

frankly: that "sitting is killing you."

But a new study puts a positive spin on the bad news about all that time spent sedentary;

the research shows that losing weight and fighting the related obesity epidemic could

be as simple as literally taking a stand.

Researchers at Sweden's University of Gothenburg believe they may have discovered the body's

second known system for regulating body weight.

"Quite simply, we have found support for the existence of internal bathroom scales,"

explains Professor John-Olov Jansson, in a statement.

"The weight of the body is registered in the lower extremities.

If the body weight tends to increase, a signal is sent to the brain to decrease food intake

and keep the body weight constant."

The study was conducted by implanting weights into the bellies of mice.

Some rodents had capsules with weight equivalent to about 15 percent of their body mass implanted

while a control group had empty capsules implanted.

After a few weeks, the two groups had nearly the same weight, with the mice implanted with

added weight apparently making up the difference by shedding white body fat.

Over two decades ago, scientists discovered that the hormone leptin helps regulate body

fat.

If the findings of the new study can be duplicated in humans, it would appear that this internal

scale amounts to another way the body keeps track of weight.

"The mechanism that we have now identified regulates body fat mass independently of leptin,

and it is possible that leptin combined with activation of the internal body scales can

become an effective treatment for obesity," said Professor Claes Ohlsson at Gothenburg

University.

And those treatments might start with some of the advice that we're already hearing today:

to get up off your seat and on to your feet.

"We believe that the internal body scales give an inaccurately low measure when you

sit down.

As a result you eat more and gain weight," says Ohlsson.

In other words, sitting could really be killing us because it distorts the body's own picture

of how much it weighs, screwing with the systems that regulate body fat.

Looks like you may want to take another look at investing in that standing desk after all.

The results are published in most recent issue of the Proceedings of the National Academy

of Sciences.

For more infomation >> The science is in: Losing Weight May Be As Simple As Standing Up - Duration: 3:05.

-------------------------------------------

simple maggam work blouse designs | basic embroidery stitches | latest new blouse back neck designs - Duration: 12:30.

easy kolam designs

For more infomation >> simple maggam work blouse designs | basic embroidery stitches | latest new blouse back neck designs - Duration: 12:30.

-------------------------------------------

Sankranthi melika muggu | easy and simple kolam designs | latest sankranti new muggulu 2018 - Duration: 3:18.

easy rangoli

For more infomation >> Sankranthi melika muggu | easy and simple kolam designs | latest sankranti new muggulu 2018 - Duration: 3:18.

-------------------------------------------

Régénération du cartilage du genou ! Cette formule simple vous aidera - Duration: 7:21.

For more infomation >> Régénération du cartilage du genou ! Cette formule simple vous aidera - Duration: 7:21.

-------------------------------------------

Five Little Babies jumping on the Bed Simple Funny Nursery Rhymes Songs Kids Children - Duration: 1:15.

Five Little Babies jumping on the Bed Simple Funny Nursery Rhymes Songs Kids Children

For more infomation >> Five Little Babies jumping on the Bed Simple Funny Nursery Rhymes Songs Kids Children - Duration: 1:15.

-------------------------------------------

17F PyQt and Qt Designer: Simple Editor - Duration: 9:13.

Welcome to Engineering Python.

This is a Python programming course for engineers.

In this video, I'll continue to discuss GUI programming using PyQt and Qt Designer.

We will create a simple rich text editor.

The text editor can do basic text editing.

You can change the size of the window, change the font, change the color, open a file, and

save a file.

The following widgets are used.

QMainWindow, QTextEdit, QMenu, QMenuBar, QAction, QFileDialog, QFontDialog, QColorDialog, QCheckBox,

and QMessageBox.

We will use the GUI development flow I introduced in a previous video to develop this program.

Step 1 is to design the interface in Qt Designer.

To start Qt Designer, you can type in designer in the Windows Start menu.

For Mac OS, type in open -a designer in a terminal to launch Qt Designer.

In this New Form dialog, because I have already created the UI, I'll just open it from my

folder.

Next, I'll briefly describe what I did when I created this graphic user interface.

I clicked the empty space in the main window.

In the property editor, set the MainWindow's geometry width to 400, height to 300.

Set the window title to Simple Editor.

In the object inspector, there was originally a status bar.

I just right clicked and removed it so you don't see it here.

We don't need it in this program.

I double clicked the menubar and changed the text to File.

I added three actions under File, Open, Save, and Exit.

I added another menu Edit and two actions under Edit, Font and Color.

In the widget box, I searched for check box.

Dragged and dropped this widget to the main window.

I double clicked and changed the text to Larger Window.

So, if this box is checked, the size of the main window will be enlarged.

If it's unchecked, the size will be back to this small window size.

I searched for text edit in the widget box.

Dragged and dropped a text edit into the main window.

Let me break out this layout first.

Then, what I did was use Control-A to select both widgets and click this lay out vertically

button.

Click an empty area in the main window and click this lay out in a grid button.

You can preview this interface by pressing Control R. It doesn't do anything yet.

We will write code to process the click of this check box and the menu bar actions later.

After we are done, we save the interface as editor_gui.ui.

It's an XML document.

Step 2 is to convert the ui file to a Python file using the following command in a command

prompt or a terminal.

pyuic5 -x editor_gui.ui -o editor_gui.py.

After that, we will get this Python file editor_gui.py.

You can open this Python file and see the content.

The entire window is an instance of this Ui_MainWindow class.

You can find all the widgets we added to the interface in this setupUI function.

Like the grid layout, the checkbox, the text edit, the menu bar, and the actions.

Some of the properties are defined in this retranslateUi function.

Do not change anything in this Python file.

Step 3 is to code in Python.

We need to create a new file named editor.py.

I already did that so I'll just open my file.

In the first line of this file, we need to import everything from editor_gui.

Then we will define the signals function to deal with the signals passed by the widgets.

We connect the Open action's triggered signal to a user-defined file open function.

An action is triggered when the menu item is clicked.

We connect the Save action's triggered signal to a user-defined file save function.

We connect the Quit action's triggered signal to a user-defined file quit function.

Next, we connect the Font action's triggered signal to a user-defined edit font function.

We connect the Color action's triggered signal to a user-defined edit color function.

We connect the checkbox's state changed signal to a user-defined enlarge window function.

The checkbox's state will change from checked to unchecked or vise versa when it's clicked.

In this file open function, we will show a file dialog and ask the user to select which

file to open.

If the user selected a file, the length of the file name will be greater than 0.

We will use the with statement to open the file, read the content, and show the content

in the text edit.

In this file save function, we will show a file dialog and ask the user to enter a filename

to save.

If the length of the file name is greater than 0, we will use the with statement to

create the file, and write the content as rich text to this file using to html.

Rich text means the formatting like the font, the size, the color is also saved in the file.

We can also save it as plain text without formatting.

In this file quit function, we will show a message box and ask the user whether they

really want to quit.

The program will end only if they click the Yes button.

In this edit font function, we will show a font dialog and ask the user to select a new

font.

If the new font is valid, we will set the font of the entire text to the new font.

In this edit color function, we will show a color dialog and ask the user to select

a new color.

If the new color is valid, we will set the color of currently selected text to the new

color.

In this enlarge window function, if the checkbox is checked, we will move the main window's

top left corner to 100 points to the left of the screen and 100 points to the top of

the screen.

We will also set the size of the window to 600 by 400.

If the checkbox is unchecked, we will set the size of the window to 400 by 300.

Next, we need to add these seven self-defined functions as new attributes in the Ui_MainWindow

class.

The rest of the code has been explained in the previous calculator example in this course.

I'll not repeat them here.

Step 4 is to execute the program.

We do it in Jupyter Notebook using the run magic.

Click the window to make it larger.

Click it again to make is smaller.

Click menu File, open, and choose The Zen of Python.

You will see the file's content.

Click menu Edit Font.

Choose Consolas.

Size is 12 and click ok.

The font is changed.

Select the first line in the text edit.

Click menu Edit Color.

Choose red and click okay.

Unselect the first line.

Now the text is changed to red.

Click File, Save.

And save it as The Zen of Python Formatted.txt.

After you are done, click menu File Quit.

The program will end.

Okay, that was how to use PyQt and Qt Designer to create a simple text editor.

The course materials are available on YouTube and GitHub.

You can watch the course videos in sequence.

If you like this video, please subscribe and share.

I'm Yong Wang.

Thanks for watching.

For more infomation >> 17F PyQt and Qt Designer: Simple Editor - Duration: 9:13.

-------------------------------------------

SIMPLE MAKEUP LOOKS | Happy New Year | Makeup Tutorial - Duration: 2:48.

Hello everyone. Welcome back to my channel.

OMG!It is fucking 2018 today!

Wow! First of January

I can't believe it

My birthday is getting closer and closer.

Plus. wonde what will 2018 bring me?

BTW Happy New Year, guys!

In today's video I will do simple makeup

Simple, relaxing, light makeup.

I hope you enjoy this video. Are you ready to watch?

This is simple makeup.

I hope you enjoy this video.

Wow. Amazing video. I just can't believe I did it.

For a couple weeks. And there will be more videos in the future.

Thanks for watching.

I hope you enjoy this video. Don't forgot to subscribe and give this video a thumb up if you like this video.

For more infomation >> SIMPLE MAKEUP LOOKS | Happy New Year | Makeup Tutorial - Duration: 2:48.

-------------------------------------------

Three simple Body Language Tricks you can use to pull Women in like a Magnet - Duration: 7:57.

Three simple body language tricks that you can use to pull women in like a magnet.

Lots of men waste lots of time thinking about what they ought to say to a woman so that

she finds them attractive.

That's great.

[0:00:14]

But what if there was a way to make women attracted to you before you said a single

word?

That's exactly what we'll cover in this video.

[0:00:24]

Most men miss the fact that their body language is constantly sending out an unbroken signal

to every person nearby, whether good or bad.

We can't not communicate.

[0:00:36]

We all do this constantly, whether we know it or not.

If you, for example, go on a first date with a woman and lean back, relaxed – you know,

you've got your arms out left and right – then just by doing that you're radiating

the sense of being self-confident and relaxed.

But when you look at the floor, and nervously pick at your fingernails, and don't hold

any eye contact – then you're communicating that you're nervous and unsure of yourself.

[0:01:03]

In short, on the basis of thousands of tiny things that you do with your body language,

you communicate, you are broadcasting a very specific message to the woman you're getting

to know, whether good or bad.

Now, please treat what I'm about to share with you as a process.

[0:01:17]

It's just like school.

You need a little while before you really understand and internalize these concepts,

but if you practice it often enough, you'll do it without having to think about it.

[0:01:26]

The best places to start are your arms and hands.

Lots of men stick their hands in their pockets because they just don't know what they should

do with them.

I myself smoked cigarettes for a really long time – though it's been a long time now

since I've done it – just because I didn't know how I should keep my hands busy.

It was an occupation for my hands more than anything else.

[0:01:47]

Hiding your hands away or sticking them in your pockets doesn't seem cool, it seems

as though you've got something to hide, or as if you're nervous and doubtful.

[0:01:56]

Once you know what to do with your hands when you're talking, you can likely take this

uncertain first impression and turn it into a self-confident and attractive presence for

women.

[0:02:08]

One of the best ways to keep your hands busy, in my opinion, is to illustrate the things

that you're saying with hand motions.

[0:02:18]

Let me give you an example.

Let's say an old friend you haven't seen for a long time drops by and visits you in

your apartment.

He rings the bell, you open the door, and say, "Welcome!"

But what you do with your body is, you don't look him in the eye, and you keep your hands

down low.

You know what I mean?

You're not greeting with your hands, you just say "Welcome" and look at the floor.

Right then, you're saying "Welcome" but you're showing him with your body language

– your hands and eye contact – that you don't have any interest at all in seeing

him and you've got a thousand other things to do besides greeting this guy at your home.

[0:02:53]

But taken another way, if the doorbell rings and you open the door and see him and say

"Welcome!" and you open your arms in a very welcoming gesture, give him a hug, look

him in the eye – what's happening is that your body language matches what you're saying,

and that comes across a hundred times more believable, convincing, and realistic.

[0:03:17] So your hands and arms are incredibly powerful

tools to complement and stress the things you're saying.

Use them!

[0:03:24]

That's the whole basis of the gesture you make when you say "Welcome!" and you open

your arms, you see?

It even comes across in the video.

The reason it comes across so inviting is that you're opening up your vulnerable side

– baring your stomach – and in that moment you're unprotected.

That communicates a huge sense of trust and confidence in him.

[0:03:45]

Next, another excellent technique that you can put into practice when you meet a woman

is to turn your shoulders away from her.

So you're standing facing her, just like I am now, I'll be the woman.

She stands here.

And you stand here, shoulder-to-shoulder with her.

You can come unbelievably close without her feeling awkward or under pressure.

On the other hand, if you turn facing this way, and start talking to her – you're

looking right at each other – she'll feel super uncomfortable and closed-in if she's

this tall and you're standing right here staring at her in the eyes.

You simply can't go right up to a woman like this, and it's nothing more than your

body language.

Like I said, if you stand at her side, you can get incredibly close; your shoulders can

almost be touching.

[0:04:29]

Above all you're opening up the possibility for you two to slowly shift position.

The longer the conversation and the better it goes, you can slowly turn and move closer,

so there's a gradual change.

You don't have that opportunity if you start directly, like most men do, right in front

of her like this, where you show maximum interest straight from the beginning.

This is too much interest too fast, and this is the way lots of men lose women right away.

[0:04:58]

Another very effective body language trick comes when you see a woman at midnight on

the street.

You make a very strong gesture like this, and say "Hey, stop real quick."

Very powerful.

Not directly in her face, but if you do something like "Stop, stop" then it works really

well to get her attention.

I've wanted to talk to tons of women on the street at any hour of the day, and I've

noticed that lots of women think you want to sell something.

They don't imagine that you just want to chat and get to know them, so they just keep

walking.

But as soon as I started using this simple little gesture, almost every single woman

stopped because it came across as so amazingly dominant.

[0:05:45]

You can also use your hands during a conversation to come across as more honest and show that

you have nothing to hide.

Just put your hands palm up, and that really shows a lot of trust.

I don't know if you're aware of this, but I found it pretty interesting, that handshakes

come from a time when people wanted to be sure that the other guy wasn't holding some

kind of weapon in his hand behind his back.

That's why handshakes came about, so people could say to themselves, "okay, at least

he hasn't got a knife in this hand."

[0:06:13]

Even today this communicates a lot of trust when you're talking with someone.

You can even see it in politicians, though you have to look closely – lots of politicians

talk with their hands up like this.

That's because they know really well what kind of unconscious trust that presents, and

they're showing that they have nothing to hide.

[0:06:30]

But the most important thing that you can use your hands and arms as tools for, is to

really underscore certain points and really show your passion for something.

This way so much more comes across when you say something or describe something.

Maybe you're noticing what I'm doing here – I've done it so much I don't even

have to think about it.

You saw that I was making this little gesture, and just through that so much more energy

and passion came through in what I was saying.

All because I was trying to underscore what I was saying with my hands.

[0:07:01] The same thing holds true when you, for example,

tell a woman a story.

I love telling stories to women because there's nothing that works so well to capture people's

attention as a story well told.

If you're talking to a woman and you say "I was in that river, and I tell you, I

thought I'd never breathe again."

You could say it like that - "I-thought-I'd-never-breathe-again," or you could say "I thought for sure I'd

NEVER breathe again!"

And as soon as you do this, you make everyone feel as if they're part of the story.

You bring everybody into what you're saying.

All through this little gesture – you yourself can't even breathe just from listening to

me tell this!

It's really that powerful!

[0:07:42]

I really hope that these tips have helped you.

Please give this video a good rating and share it with other men so it can help them too.

[0:07:49]

But honestly, this is exactly the tip of the iceberg when it comes to what you have to

know to seduce women with your body language, without saying a word.

And exactly that is what you'll learn in my free offer, "How you can get just about

any girl – in bed or in a relationship."

You can get it with a single click on the free download button, so grab yourself a copy

now and check it out.

[0:08:07]

Aside from that, I'll also regularly send you PDFs, MP3s, and training videos about

making women crazy about you with just your body language.

[0:08:14]

These are completely full of secrets that will help you use gestures and eye contact

to make women entranced by you – and most men will never find them out.

So click now on the free download button and we'll see each other on the other side in

the free reports and training videos.

Till then.

[0:08:30]

For more infomation >> Three simple Body Language Tricks you can use to pull Women in like a Magnet - Duration: 7:57.

-------------------------------------------

5 Simple Home Remedies For Cracked Heels - Duration: 2:41.

One thing that is both annoying and uncomfortable, and can become quite unsightly, is a cracked

heel.

These little problems can become quite a nuisance to you, as well as become very painful.

A cracked heel can come from dry and thickened skin.

It can also cause these unpleasant symptoms:

- Redness - Itching

- Inflammation or swelling - Peeling skin

When you see these issues forming, it is important to take action right away.

Quick action will reduce the symptoms and prevent the crack from getting deeper and

bleeding.

Cracked heels are caused by a variety of different things:

- Dry air - Lack of moisture

- Not caring for your feet properly - Unhealthy diet

- Aging - Standing for long period

- Improper foot wear

You may also be more likely to develop cracked heels if you have been diagnosed with the

following conditions:

- Eczema - Psoriasis

- Corns and Calluses - Diabetes

- Thyroid Disease

Here are several ways to treat cracked heels right at home:

1.

Lemon, salt, glycerin, rose water foot mask:

Before you can enjoy those heels again, you must heal your skin.

This mask is perfect for taking care of cracked heels.

2.

Vegetable Oil

Vegetable oil is beneficial to more than just baking tasty treats.

Since feet usually crack because of dry skin, keeping them moist is the secret to getting

rid of cracked heels and preventing them from occurring.

3.

Bananas

Ripe bananas are one of the cheapest home remedies for cracked and dry heels, thanks

to their moisturizing properties.

You can also create a foot mask at home using a ripe banana and avocado.

Avocados and coconuts are high in essential oils, vitamins, and fats.

Because of this, the mixture treats cracked heels and keeps your feet soft and moisturized.

4.

Vaseline and lemon juice

Another interesting mixture that can cure your cracked heels is Vaseline and lemon juice.

5.

Paraffin Wax

This is very helpful way to heal your cracked and painful heels.

If you like the video, give it a thumbs up and share it with your friends!

If you want more recipes and tips, subscribe to the channel!

For more infomation >> 5 Simple Home Remedies For Cracked Heels - Duration: 2:41.

-------------------------------------------

Greeting card | How to make a simple greeting card | 3d card - Duration: 1:36.

take a paper size of the card you want to make

cut them

don't cut them

fold them inside

stick them together with paper glue

For more infomation >> Greeting card | How to make a simple greeting card | 3d card - Duration: 1:36.

-------------------------------------------

SIMPLE LIFE HACK WITH ROPE | DR/Hamdallah - Duration: 3:29.

the items we will use in the video

Old Rope

then we will paint it

put your cup on it and enjoy

subscribe and turn the bell on to watch all videos

For more infomation >> SIMPLE LIFE HACK WITH ROPE | DR/Hamdallah - Duration: 3:29.

-------------------------------------------

17B PyQt and Qt Designer: Simple Calculator - Duration: 12:35.

Welcome to Engineering Python.

This is a Python programming course for engineers.

In this video, I'll continue to discuss GUI programming using PyQt and Qt Designer.

We will create a simple calculator.

This simple calculator can perform simple math operations such as addition, subtraction,

multiplication, and division.

We will use the following widgets in this program.

QMainWindow, QPushButton, QLineEdit, QComboBox, QLabel, QStatusBar, and QMessageBox.

We will use the GUI development flow I introduced in a previous video to develop this program.

Step 1 is to design the interface in Qt Designer.

To start Qt Designer, you can type in designer in the Windows Start menu.

For Mac OS, you can try open -a designer in your terminal to launch Qt Designer.

In this New Form dialog, we always choose Main Window and click Create.

Because I have already created the UI, I'll just open it from my folder.

In the view menu, check all these items to show these tool boxes.

This is the Widget box.

This is the object inspector.

This is the property editor.

This is the resource browser.

This is the action editor.

This is the signal slot editor.

Next, I'll briefly describe what I did when I created this graphic user interface.

I clicked the empty space of the main window.

In the property editor, set the MainWindow's geometry width to 400, height to 200.

Set the window title to Calculator.

In the object inspector, there was originally a menubar.

I just right clicked and removed the menubar so you don't see it here.

We don't need it in this program.

In the widget box, I searched for line edit.

Dragged and dropped this widget to the main window.

I repeated this process two more times.

So, you see three line edits here.

I changed their objectNames to lineEdit1, lineEdit2 and lineEdit3.

Changed their toolTips to First Number, Second Number, and Result, respectively.

So, when we run this program later and hover the mouse on these line edits, we will see

these tooltips.

I searched for combo box in the widget box.

Dragged and dropped a combo box to the main window.

Double clicked the combo box, added four operators, plus, minus, star, which means times, and

slash, which means divided by.

Set the toolTip to Operator.

Then, I searched for label in the widget box.

Dragged and dropped a label to the main window.

Double clicked the label and changed the text to equal.

I searched for pushbutton in the widget box.

Dragged and dropped a pushbutton to the main window.

Double clicked it and changed the text to Clear.

Changed the objectName to buttonClear in the property editor.

Changed the statusTip to Clear All the Boxes.

It will show a tip in the status bar if we hover the cursor on top of this button.

I repeated this process and added another pushButton, changed the text to Calculate,

and changed the objectName to buttonCalc.

Changed the statusTip to Calculate the Result.

Let me break out this layout first.

Then, what I did was selecting the top five widgets and click this lay out horizontally

button.

Select the bottom two buttons and click this lay out horizontally button.

Use Control-A to select all the widgets and click this lay out vertically button.

Click an empty area in the main window and click this lay out in a grid button.

After that, I selected the push button Clear.

In the signal slot editor, I added a signal.

Double clicked the sender and selected buttonClear.

Double clicked the signal and selected clicked.

Double clicked the receiver and selected lineEdit1.

Double clicked the slot and selected clear.

I added two more signals, changed the receivers to lineEdit2 and lineEdit3, respectively.

What this does is that, when we click the clear button, the contents of these three

line edits will be cleared.

You can preview this interface by pressing Control R or clicking the menu Form Preview.

Type in some numbers and click clear.

It works.

However, the Calculate button does nothing.

We will write code to process the click of this button later.

After we are done, we save the interface as calculator_gui.ui.

If you are interested, you can open this ui file and take a look in the Jupyter editor.

It's actually an XML document.

Step 2 is to convert the ui file to a Python file using the following command in a command

prompt or a terminal.

pyuic5 -x calculator_gui.ui -o calculator_gui.py After that, we will get this Python file calculator_gui.py.

You can open this Python file and see the content.

This file translated the ui file to a Python file using PyQt5.

The entire window is an instance of this Ui_MainWindow class.

You can find all the widgets we added to the interface in this setupUI function.

Like the grid layout, the line edits, the combo box, the pushButtons, and the status

bar.

Some of the properties are defined in this retranslateUi function.

Don't change anything in this Python file.

All changes made in this file will be lost if you use the pyuic5 command again to convert

the ui file to this py file.

Step 3 is to code in Python.

We need to create a new file named calculator.py.

I already did that so I'll just open my file.

But you need to write this entire file by yourself if you are writing a new program.

Note this is different from the calculator_gui.py.

In the first line of this file, we need to import everything from calculator_gui.

Then we will define the signals function to deal with the signals passed by the widgets.

This line will connect the Calculate button's clicked signal to a user-defined calc function.

In this calc function, we will do the actual math calculation.

After the user typed in some numbers.

We give the text in lineEdit1 to a and the text in lineEdit2 to b.

They will be the first number and the second number.

We give the currentText in the combo box to operator.

It will be one of the plus, minus, times, and divided by operators.

Next, we try to calculate the result by assembling these three strings in one expression and

executing that expression.

For example, if a is 2, b is 4, and the operator is a star, the eval function will do the multiplication.

Then we show the calculation result 8 in lineEdit3.

Some errors may occur when the Calculate button is clicked.

For example, lineEdit1 or lineEdit2 is empty, or a number is divided by 0.

If an error occurs, we use a message box to show a critical error message like invalid

inputs.

The user needs to confirm this error by clicking the Ok button before he or she tries again.

Next, we need to add these two self-defined functions as new attributes in the Ui_MainWindow

class.

This calculator.py file can be run as a stand-alone program, it can also be imported to other

programs as a library.

If it is run as a stand-alone program like what we will do later, we will need to import

the sys library.

Every PyQt5 program must create a QApplication object.

If this program is run in the command line, sys dot argv allows the user to pass additional

parameters.

This statement will create a main window instance.

This one will create a Ui_MainWindow instance.

Next, we add all the widgets to the main window.

Connect the signals or events with the appropriate functions or actions.

Show the main window on the computer screen.

Wait for the termination signal.

It will receive a termination signal when the user clicked the close window button on

the top right or top left corner, depending on whether you are running windows or mac

os.

If a termination signal is captured, exit the program.

Step 4 is to execute the program.

We do it in Jupyter Notebook using the run magic.

Type in some numbers like 8 and 7.

Change the combo box to minus.

Then click Calculate.

The result is 1.

Click the clear button.

Type in 4 and 0.

Choose divided by in the combo box.

Click Calculate.

We will see an error message, invalid inputs.

Change the second number to 8 and click Calculate.

The result is 0.5.

Click the close window button.

The program will end.

Okay, that was how to use PyQt and Qt Designer to create a simple calculator.

The course materials are available on YouTube and GitHub.

You can watch the course videos in sequence.

If you like this video, please subscribe and share.

I'm Yong Wang.

Thanks for watching.

Không có nhận xét nào:

Đăng nhận xét