Instead of typing so many of those functions, you can create ONE function to capture and display all buttons. def one_function(self, button) : text = self.label.text() self.label.setText(text+button) Thats it... You then pass the character to the function using a lambda expression self.button1.clicked.connect(lambda: self.one_function("1")) You're welcome
You can just bind all (0-9) buttons with same function then. find sender button's text and append it. I know in C++, but should be similar in python. In C++ void NumberButtonClicked() { QPushButton *btn = reinterpret_castQObject::sender(); label->setText(label->text() + btn->text()); } It is not complete, but just to show to sender().
For × symbol, you can press and hold Alt key and then press 0 2 1 5 on number pad. Similarly, you can search the Alt code for division symbol on Google.
bhai yr jb bhi m butoon me click kr rha hun to button ka text to label pe show ho rha hh pr jase hi m koi ur button pe click kr rha hun to vo button bhi label pe aa rha hh pr picha button remove ho jaa rha hh label se bhai solution batao
Bhai ap string ko append nhi kr rhe Apne code me dekhe Phle apko jo v lebel me hai use store krna hai Than jo stor kiya hai Uska sath apko lebel me set krna hai Jaise ki hmne Ek text variable liya ukme stor kr liya Ab jb koi button click kro than Jaise ki hm 1 click kr rhe to self.lebel.setText(text+"1") Video ke coding part dekhe ap Usme method_1 hoga use ap apne code se match kre
the best ever love you so much man helped with my project
Instead of typing so many of those functions, you can create ONE function to capture and display all buttons.
def one_function(self, button) :
text = self.label.text()
self.label.setText(text+button)
Thats it... You then pass the character to the function using a lambda expression
self.button1.clicked.connect(lambda: self.one_function("1"))
You're welcome
How to convert * to x and / to divide symbol
You can just bind all (0-9) buttons with same function then. find sender button's text and append it. I know in C++, but should be similar in python.
In C++
void NumberButtonClicked()
{
QPushButton *btn = reinterpret_castQObject::sender();
label->setText(label->text() + btn->text());
}
It is not complete, but just to show to sender().
nice
After convert, double click .py shows cmd prompt and voila. Nothing happened. What?
Nice
Grasias amigo, + un nuevo sub
very very good sir
Sir how to convert * to x and / to divide symbol
Pls give me rply
For × symbol, you can press and hold Alt key and then press 0 2 1 5 on number pad. Similarly, you can search the Alt code for division symbol on Google.
Bhai internshala wale python project me explanation ki bhi ek video bna de
Reply to de bhai
Okay bro
Bro when i click the py file it just opens the cmd and closes pls help
Make sure you installed pyqt5 as pip install and IDLE
bhai mere me Ui main window not defined error araha h , plz help
Have you converted ui file to py file?
@@madnessoftech6908 yes sir!
bhai yr jb bhi m butoon me click kr rha hun to button ka text to label pe show ho rha hh pr
jase hi m koi ur button pe click kr rha hun to vo button bhi label pe aa rha hh pr picha button remove ho jaa rha hh label se
bhai solution batao
bhai jase 1 pe click krke 1 label pe aa rha hh
pr jase hi m button2 pe click kr rha hun to label se 1 remove ho jaa rha hh sirf 2 hi show ho rha hh
Bhai ap string ko append nhi kr rhe
Apne code me dekhe
Phle apko jo v lebel me hai use store krna hai
Than jo stor kiya hai
Uska sath apko lebel me set krna hai
Jaise ki hmne
Ek text variable liya ukme stor kr liya
Ab jb koi button click kro than
Jaise ki hm 1 click kr rhe to
self.lebel.setText(text+"1")
Video ke coding part dekhe ap
Usme method_1 hoga use ap apne code se match kre
@@madnessoftech6908 thanks bro for helping right now i get my mistake
Hello sir
Please give me the source code of this python calculator . I shall make a minor project.so plz give me the source code .
Okk find link in discription box
@@madnessoftech6908 Thanks a lot sir 🔥❤️
индус скинь кодик а