if you wish to leave some values blank method 1 = you can use e1.insert(0,"0) method 2: def calculate(): # getting the values sugar = e1.get() if not sugar: sugar = 0 rice = e2.get() if not rice: rice = 0 jelly = e3.get() if not jelly: jelly = 0 beans = e4.get() if not beans: beans = 0 total =(int(sugar)*10 + int(rice)*5 + int(beans)*4 + int(jelly)*7) print(total)
Use the function e.insert(0,"0"), the reason you get the value is becasue there is no input, so by inserting 0 yourself it will always be fine. So in the example he shows the answer would be: e1=Entry(window) e1.inset(0,"0") e1.place(x=250, y150) same goes for all entries
Hi..very nice and simple explanation Easy to understand... Can u clarify one thing If we give amount of any of 2 items out of 4 whether it will through any error.?? Remaining two items takes zero value while adding?
hi. i like your video and your explanation. if you can help me, can u just put your final fungtion here? cos i got the middle test about gui tkinter. thx before
hello python programmer so as u have asked about the bug fixing we can do the following where ever you want to leave a blank you can ask the user or make it default to assume that it is zero( 0) or a dash(---) i have figured the bug please tell me how to apply it
we will apply the logic of if not if not peach_juice: peach_juice = "0" if not raspberry_juice: raspberry_juice = "0" if not pineapple_juice: pineapple_juice = "0" if not banana_shake: banana_shake = "0" # Calculate the total price total = (int(peach_juice)*100) + (int(raspberry_juice)*150) + (int(pineapple_juice)*130) + (int(banana_shake)*140) # Display the total price label12 = Label(window, text=total, font="times 18 bold") label12.place(x=100, y=430)
Could you help with this, I want to get a number from a interface (GUI) in Python, I enter 5.5 for example but when I try to multiply out of mainloop this entry by 2 it shows 0, I verifity the type of variable before multiply and it says is a float. here the code: from tkinter import * ventana = Tk() ventana.geometry("500x80") def send_data1(): e1 = float(entrada1.get()) entrada1.delete(0, END) print (e1) entrada1 = StringVar() e1 = float() entrada1 = Entry(ventana, width="8") entrada1.place(x = 20, y = 8) entrada1_entry = Entry(textvariable = entrada1) boton1 = Button(ventana, text="data", command=send_data1, width="40", height="1", bg="#DC143C") boton1.place(x=100,y=5) ventana.mainloop() In GUI e1 = 5.5 print (2 * e1) print(type(e1)) 0.0
Hello python programmer Back again with a new doubt How do you decide where to place the labels etc. Do you take help of any tool? Also make a file sorter in python which sorts files according to their extentions like .text .mov .ppt etc....
if you wish to leave some values blank
method 1 = you can use e1.insert(0,"0)
method 2:
def calculate():
# getting the values
sugar = e1.get()
if not sugar:
sugar = 0
rice = e2.get()
if not rice:
rice = 0
jelly = e3.get()
if not jelly:
jelly = 0
beans = e4.get()
if not beans:
beans = 0
total =(int(sugar)*10 + int(rice)*5 + int(beans)*4 + int(jelly)*7)
print(total)
Use the function e.insert(0,"0"), the reason you get the value is becasue there is no input, so by inserting 0 yourself it will always be fine.
So in the example he shows the answer would be:
e1=Entry(window)
e1.inset(0,"0")
e1.place(x=250, y150)
same goes for all entries
jeeta reh janooo very good
Declare variable
a= IntVar()
e1 = Entry(window, textvariable = a)
Hi..very nice and simple explanation
Easy to understand...
Can u clarify one thing
If we give amount of any of 2 items
out of 4 whether it will through any error.?? Remaining two items takes zero value while adding?
Nice frontend..👍🏻.
Please , upload the video of database connectivity too.
Thanx , actually i have many videos on database on this channel this was just a project i made when i was getting bored 😂😂 😂
Yes please upload database connectivity
hi. i like your video and your explanation. if you can help me, can u just put your final fungtion here? cos i got the middle test about gui tkinter. thx before
hello python programmer
so as u have asked about the bug fixing
we can do the following
where ever you want to leave a blank you can ask the user or make it default to assume that it is zero( 0) or a dash(---)
i have figured the bug please tell me how to apply it
hey you can add sqlite3 DB so that the bill will be saved and can be retrieved later :):)
Please can you suggest a video or site that shows how to go about this?
Bro i am a beginner in python can you say me how to start learning means books or any online source or your videos are enough??
Learn syntax first, some easy functions (classes, functions, ...) then choose some project and start learning frameworks and modules :)
ruclips.net/video/_uQrJ0TkZlc/видео.html
we will apply the logic of if not
if not peach_juice:
peach_juice = "0"
if not raspberry_juice:
raspberry_juice = "0"
if not pineapple_juice:
pineapple_juice = "0"
if not banana_shake:
banana_shake = "0"
# Calculate the total price
total = (int(peach_juice)*100) + (int(raspberry_juice)*150) + (int(pineapple_juice)*130) + (int(banana_shake)*140)
# Display the total price
label12 = Label(window, text=total, font="times 18 bold")
label12.place(x=100, y=430)
Could you help with this, I want to get a number from a interface (GUI) in Python, I enter 5.5 for example but when I try to multiply out of mainloop this entry by 2 it shows 0, I verifity the type of variable before multiply and it says is a float. here the code:
from tkinter import *
ventana = Tk()
ventana.geometry("500x80")
def send_data1():
e1 = float(entrada1.get())
entrada1.delete(0, END)
print (e1)
entrada1 = StringVar()
e1 = float()
entrada1 = Entry(ventana, width="8")
entrada1.place(x = 20, y = 8)
entrada1_entry = Entry(textvariable = entrada1)
boton1 = Button(ventana, text="data", command=send_data1, width="40", height="1", bg="#DC143C")
boton1.place(x=100,y=5)
ventana.mainloop()
In GUI e1 = 5.5
print (2 * e1)
print(type(e1))
0.0
pleasure watching this!!!!!!!!!!!
if i=='' '':
i.set(0)
Might that works 👍👍
hi,please tell about the reset button option
Your provided online training class
if I wanted to, How do i change the color?
Thank you so much ❤️😊
Hey bro need your help in my program i dont know what to do next i am stuck.
Bro , what will be the condition if any entry is vacant,,,,, pls reply********(#BUG)
I'm getting only one label item on my GUI page
Sir plz tell me the solution of error that you left
Is there any source code? If available plz provide I guess I am missing something there is a error in my program.
how to connect to printer
Bhai humko itna hi ata to app ki video kyu dekte
💯💯💯Thanks , very very thanks ,I am also subscribe you ,
Code dede bhai
Hello python programmer
Back again with a new doubt
How do you decide where to place the labels etc.
Do you take help of any tool?
Also make a file sorter in python which sorts files according to their extentions like .text .mov .ppt etc....
No bro i just try them at different places and see how it looks
And nice idea i will work on this project and will upload tutorial asap
@@Iknowpython plz tell me the bug sir I am a beginner and I want to submit this project in 2-3 days plz sir 🙏
Anyone plz share the source code
hello sir i need a bit help on gui maker . could you please provide me a mail id for further interaction
regards
Sudhanshu