Remove Labels - Python Tkinter GUI Tutorial #41

  Рет қаралды 64,757

Codemy.com

Codemy.com

Күн бұрын

Пікірлер: 127
@jaylooppworld381
@jaylooppworld381 3 жыл бұрын
i will never understand how people can dislike this, he is literally giving us all this knowledge so EASY and for FREE and some people dare to give a thumbs down, thats INSANELY STUPID
@Codemycom
@Codemycom 3 жыл бұрын
agreed!
@ethanchilton2345
@ethanchilton2345 4 жыл бұрын
Big fan of your tutorials! Super helpful for someone starting out with tkinter. Keep at it!
@Codemycom
@Codemycom 4 жыл бұрын
Thanks, will do!
@Kennerdoll
@Kennerdoll 3 жыл бұрын
You are the man. GOD bless you and your family
@Codemycom
@Codemycom 3 жыл бұрын
Thanks, you too!
@Codemycom
@Codemycom 4 жыл бұрын
▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My KZbin Channel: bit.ly/2UFLKgj bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com Take $30 off with coupon code: youtube1
@jesterlw
@jesterlw 4 жыл бұрын
Im learning a lot quicker then I thought I would thanks to your videos
@Codemycom
@Codemycom 4 жыл бұрын
Glad to hear it!
@aljoker012
@aljoker012 4 жыл бұрын
to make your text changes dynamically use textvariable thank you a lot mr john for this awesome course
@duhmi
@duhmi 3 ай бұрын
Thanks from my heart I learn a lot from your videos
@Codemycom
@Codemycom 3 ай бұрын
Glad to hear that
@elliot1784
@elliot1784 4 жыл бұрын
why wouldn't the best option be just to reconfigure the label with the new user input each time? (label.config)
@deshanfernando7982
@deshanfernando7982 3 жыл бұрын
this seems to work just fine, or even better. Instead of having a separate delete method I just used label.configure() on the myClick method.
@Kennerdoll
@Kennerdoll 3 жыл бұрын
@@deshanfernando7982 How bro ?
@Vivian-yf4qw
@Vivian-yf4qw 4 жыл бұрын
Thank you! Your tutorials are super helpful 😊
@Codemycom
@Codemycom 4 жыл бұрын
Glad you like them!
@sweeneytodd2518
@sweeneytodd2518 4 жыл бұрын
thx so much John for charing these awesome videos! The videos are very helpful and u r just a great teacher. Greetz from Germany 👍
@Codemycom
@Codemycom 4 жыл бұрын
Thanks so much! I appreciate it!
@francodiaz2526
@francodiaz2526 4 жыл бұрын
Hello, when i run the program appears"AttributeError: 'NoneType' object has no attribute 'pack_forget'".Why is this happening?. Its only when i click on "Delete Button". Sorry bad my english for... ^-^
@sks6270
@sks6270 2 жыл бұрын
I was looking for this for a long time thank you
@Codemycom
@Codemycom 2 жыл бұрын
Glad you found it!
@gorillacapers
@gorillacapers 4 жыл бұрын
John, suppose you click on 'Enter your name' multiple times, the name will be printed multiple times one below the other. How can we delete all instances of the labels at once? If you have already discussed this can you please tell me which videos to look at?
@Codemycom
@Codemycom 4 жыл бұрын
I'm sure I have, but I don't recall where
@netharuM
@netharuM 4 жыл бұрын
sir cant we use pixel without grid or pack
@user-pu4xj1bv3u
@user-pu4xj1bv3u 2 жыл бұрын
Hello, if we put an If in function myClick and we put a label in this If, remove will not work because the label is not defined. Solution ?
@Codemycom
@Codemycom 2 жыл бұрын
Define it, make it global
@davza9629
@davza9629 4 жыл бұрын
I don't know if I have overlooked it or not, but how do you recall a widget after using either grid or pack_forget?
@Codemycom
@Codemycom 4 жыл бұрын
In the normal way you always call a widget
@yudhistiraofficial1475
@yudhistiraofficial1475 3 жыл бұрын
how to do that without button
@Codemycom
@Codemycom 3 жыл бұрын
Do you mean with telepathy?
@tamyezalisaleh2800
@tamyezalisaleh2800 4 жыл бұрын
Thank you بارك الله فيك
@Codemycom
@Codemycom 4 жыл бұрын
You're welcome!
@Kennerdoll
@Kennerdoll 3 жыл бұрын
John, what if you only have one button (Enter your name), then you want to clear the previous label before the next one appears on the same line or for shot can the same task you are doing there be archived with only one button?
@Codemycom
@Codemycom 3 жыл бұрын
Use .config()
@kleinerdiamant-bs
@kleinerdiamant-bs 2 жыл бұрын
I always get AttributeError: “NoneType” object has no attribute “pack_forget”. Pls help :(
@Codemycom
@Codemycom 2 жыл бұрын
Did you define the thing, and pack the thing on the same line? You can't do that.
@shaanlashkari8769
@shaanlashkari8769 3 жыл бұрын
@2:29/9:57 Instead of writing "end" it should be "END" in uppercase
@zgreatest69
@zgreatest69 4 жыл бұрын
I do want to make a intro but when I say 'time.sleep(5)' and remove the label the program waits for 5 seconds and then my root is visible please help
@mohammedkamran8559
@mohammedkamran8559 4 жыл бұрын
How do I delete multiple labels under the same variable name,which r being displayed using a loop,like if I use destroy or forgot method it only deletes the last label displayed but the rest of the label's still remain,can u help me out sir, please
@shubhammali2072
@shubhammali2072 3 жыл бұрын
Is this method aplicable for images that after opening second image forgot first image as well as label ?
@Codemycom
@Codemycom 3 жыл бұрын
yes
@BrianHartman
@BrianHartman 2 жыл бұрын
When I try this in my code I get TypeError: pack_forget() missing 1 required positional argument: 'self' Any ideas?
@livenere
@livenere 4 жыл бұрын
hi, what it you put three labels on the screen and you wanted to delete the last two, how would you do that. right now I am only able to remove the last label added.
@Codemycom
@Codemycom 4 жыл бұрын
in the same way you would remove any label.
@kganeshvaidyanathan174
@kganeshvaidyanathan174 2 жыл бұрын
I'm very glad I found this video!!! Thank you so much, very helpful🙂👍
@Codemycom
@Codemycom 2 жыл бұрын
Glad you liked it!
@cristianarellano5991
@cristianarellano5991 2 жыл бұрын
Can you help me, when I disable the button it says the following error: btcalcular['state'] = DISABLED #btcalcucar is name button NameError: name 'DISABLED' is not defined
@cristianarellano5991
@cristianarellano5991 2 жыл бұрын
I solve it : btcalcular.configure(state='disabled') in phyton 3.10.8
@halflight8811
@halflight8811 3 жыл бұрын
I am using this method to forget every widget in tkinter but I am not able to restore it: def settings(): list = root.place_slaves() for l in list: l.forget()
@soumiljena427
@soumiljena427 4 жыл бұрын
Ok so i am using the .destroy() function but.. it doesnt work and it doesnt print an error so please help because i dont know whether this is a version problem or just if i am doing it wrong
@Codemycom
@Codemycom 4 жыл бұрын
It's not a version problem, you're likely just doing it wrong...
@suzum0978
@suzum0978 4 жыл бұрын
sir i m using the .grid() instead of .pack() and when i want to delete the label with .destroy() method i doesn t work
@Codemycom
@Codemycom 4 жыл бұрын
Has nothing to do with grid or pack, you likely have a typo somewhere
@suzum0978
@suzum0978 4 жыл бұрын
@@Codemycom Thanks sir i fixed it , Your vids are awesome !
@moris933
@moris933 4 жыл бұрын
Hi, how we can use Bash(Shell) in tkinter? Entry-> label-> take label to subproces -> example 'grep label_text filepathfromsecondentry -> save output in file from entrynumber3
@Codemycom
@Codemycom 4 жыл бұрын
The same way you would ever use Bash(shell) in any python program...
@nikhilsrinivas709
@nikhilsrinivas709 4 жыл бұрын
Could we do this with images?I am trying to display 700 images from a file onto a gui,I display one and then overwrite it after 0.5 s
@Codemycom
@Codemycom 4 жыл бұрын
Not sure what you mean
@ImTheBoss914
@ImTheBoss914 4 жыл бұрын
Is there any way to delete the label automatically? Like You click the button to submit your name, then the label shows for 5 seconds or so then gets deleted?
@Codemycom
@Codemycom 4 жыл бұрын
yep...I have videos on timers on the playlist
@Se_1364
@Se_1364 4 жыл бұрын
how can i replace a specific word in text widget ? ... for example i typed words then i selected one of them and used text.selection_get() method, i want to replace the word i select with another word.
@Codemycom
@Codemycom 4 жыл бұрын
Try string replace variable.replace(old, new)
@Se_1364
@Se_1364 4 жыл бұрын
actually the word will replaced after right-clicking, but I just don't know how to replace only the word I selected not the whole text.
@Codemycom
@Codemycom 4 жыл бұрын
@@Se_1364 yeah, string replace works there. variable.replace("red", "blue") replaces the word red with the word blue. Obviously you'll have to tweak it for tkinter.
@Se_1364
@Se_1364 4 жыл бұрын
Codemy.com thank you I will try it
@kuchthogudbudhai11
@kuchthogudbudhai11 2 жыл бұрын
does it work for button also??
@Codemycom
@Codemycom 2 жыл бұрын
yes
@quangdungtran2005
@quangdungtran2005 2 жыл бұрын
Thank you very much
@Codemycom
@Codemycom 2 жыл бұрын
Welcome!
@netharuM
@netharuM 4 жыл бұрын
its easy to do it just use destroy cmd or wnt to change text on label just type label.config(text="codemy.com")
@Codemycom
@Codemycom 4 жыл бұрын
yeah, we do that several thousand times throughout this playlist :-p
@netharuM
@netharuM 4 жыл бұрын
@@Codemycom :-D
@netharuM
@netharuM 4 жыл бұрын
@@Codemycomi learn python gui from you john your a great teacher thanks from sri lanka
@Codemycom
@Codemycom 4 жыл бұрын
@@netharuM Glad you're enjoying the videos!
@shaanlashkari8769
@shaanlashkari8769 3 жыл бұрын
Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\shaan\anaconda3\lib\tkinter\__init__.py", line 1883, in __call__ return self.func(*args) File "C:\Users\shaan\Downloads\ADV-C145-student-20201209T202452Z-001\ADV-C145-student\SuveyAPP.py", line 19, in remove label_title.destroy() AttributeError: 'NoneType' object has no attribute 'destroy' This error has no clue to solve it. I Tried it a thousand times but it didn't work
@Codemycom
@Codemycom 3 жыл бұрын
You packed and defined your label on the same line didn't you? Don't do that.
@bharaths1396
@bharaths1396 4 жыл бұрын
Hello sir how would i delete the label without the delete button inside the myclick function itself so that after printing the name for first time and then when i type other name and click the enter my name button the previous name is deleted and the new name is printed in the window please help me with this
@Codemycom
@Codemycom 4 жыл бұрын
use .config()...I have videos on this in the playlist
@bharaths1396
@bharaths1396 4 жыл бұрын
@@Codemycom sir I have used it works for smaller programs but in larger programs like hangman game it doesn't work It gets overridden
@allanhowitt
@allanhowitt 2 жыл бұрын
showLFSlabel.pack_forget() AttributeError: 'NoneType' object has no attribute 'pack_forget', i dunno why that error
@Codemycom
@Codemycom 2 жыл бұрын
You probably defined and packed the label all on the same line. You can't do that.
@technicalgyan7724
@technicalgyan7724 4 жыл бұрын
sir, destroy() function does not work tell me why!!!!
@Codemycom
@Codemycom 4 жыл бұрын
Because you're using it wrong or there's an error in your code
@clarkjeans2221
@clarkjeans2221 3 жыл бұрын
Thx John, 감사합니다!
@Codemycom
@Codemycom 3 жыл бұрын
Sure thing!
@eswarajaynimmaluri2056
@eswarajaynimmaluri2056 2 жыл бұрын
How can we delete each single entry every time by clicking button ?
@Codemycom
@Codemycom 2 жыл бұрын
give the button a command that points to a function that does exactly that
@tariqsssxec1963
@tariqsssxec1963 11 ай бұрын
i am learning python, as it is my hobby learning codding,i wish to be professional in python, how can you help me,, i like the way you explain though you are little fast.
@Codemycom
@Codemycom 11 ай бұрын
Just watch all the videos on my channel
@wizly_17
@wizly_17 4 жыл бұрын
How to delete a label on a grid though? Need help :(
@Codemycom
@Codemycom 4 жыл бұрын
In the same way... it being on a grid is irrelevant
@abnalgeria4598
@abnalgeria4598 Жыл бұрын
hi ! how can i remove a label with the same button
@Codemycom
@Codemycom Жыл бұрын
doesn't this video show you that?
@abnalgeria4598
@abnalgeria4598 Жыл бұрын
@@Codemycom No i mean remove it with the same buttom that enter it like a sign up thing if the password has less than 8 characters the label shows up and if he edit it and make it more than 8 char the label goes
@Codemycom
@Codemycom Жыл бұрын
@@abnalgeria4598 sure, use basic python for that. I don't have videos on it but it would be trivial with a little if/else logic.
@abnalgeria4598
@abnalgeria4598 Жыл бұрын
@@Codemycom it showed an eror but im gonna try again anyway thnx btw love ur videos
@guipython
@guipython 2 жыл бұрын
this today is not working anymore, python 3.10 know why?
@Codemycom
@Codemycom 2 жыл бұрын
You're wrong, it works fine today. You just did it wrong.
@BabaG_69
@BabaG_69 2 жыл бұрын
Really love you videos. But i have one problem, when i create more than one label and then try to delete more than one i can only delte one label and not the other ones. can anybody tell me why that is?
@Codemycom
@Codemycom 2 жыл бұрын
It's because you're doing something wrong. Are you naming the labels all the same thing or something?
@BabaG_69
@BabaG_69 2 жыл бұрын
@@Codemycom yeah I create them with a function and then put all of them in a list and then i tried to to destroy them in from the list but it doesn't work. But I also found your video about the todo list and that's what I'm looking for.
@oracle_professor
@oracle_professor 2 жыл бұрын
bad window path name error
@Codemycom
@Codemycom 2 жыл бұрын
What did you do differently from the video?
@ua2894
@ua2894 3 жыл бұрын
Can we maybe get a "Boom! Nothing happens" tshirt
@Codemycom
@Codemycom 3 жыл бұрын
Ha!
@stunamvap8617
@stunamvap8617 4 жыл бұрын
please, how can we save, in a text file, all the values of variables coming from the Print command, displayed in the "RUN" window of PyCharm. I'm a beginner. Mecri of your time
@Codemycom
@Codemycom 4 жыл бұрын
Sorry, I don't use pycharm, so I have no idea. But you can google "Python save to text file" to learn how to read and write to a text file.
@santimontion4600
@santimontion4600 4 жыл бұрын
why heisenberg is teachin python?
@Codemycom
@Codemycom 4 жыл бұрын
Why not?! lol
@afhamfardeen2448
@afhamfardeen2448 4 жыл бұрын
how to destroy a placed label insted of pack
@Codemycom
@Codemycom 4 жыл бұрын
.destroy() usually does the trick
@wowohoo7859
@wowohoo7859 2 жыл бұрын
forget is not defined How to fix it?
@Codemycom
@Codemycom 2 жыл бұрын
define it
@khaledzhouh7496
@khaledzhouh7496 Жыл бұрын
HOW to change a label in tkinter and not change the new label when you restart the program
@Codemycom
@Codemycom Жыл бұрын
Everything always reverts when you restart it, unless you use a database to record the changes. Or some other save method.
@chrisgettier6409
@chrisgettier6409 2 жыл бұрын
nice
@Codemycom
@Codemycom 2 жыл бұрын
Thanks
@shaanlashkari8769
@shaanlashkari8769 3 жыл бұрын
@3:49 this thing also happened with me
@Education_Hub101
@Education_Hub101 3 жыл бұрын
How to delete all LABEL WIDGETS in tkinter
@Codemycom
@Codemycom 3 жыл бұрын
loop thru and destroy all children..I have videos on it in the playlist
@juancarlossoto3748
@juancarlossoto3748 3 жыл бұрын
Now, how to erase Entry boxes? I do that?????
@Codemycom
@Codemycom 3 жыл бұрын
I have videos on that.
@garikinarajesh1999
@garikinarajesh1999 4 жыл бұрын
how to delete label without using button
@Codemycom
@Codemycom 4 жыл бұрын
Do you mean telepathically?
@garikinarajesh1999
@garikinarajesh1999 4 жыл бұрын
@@Codemycom I developed love calculator application using tkinter in python I am unable to delete label without clicking on a button
@Codemycom
@Codemycom 4 жыл бұрын
@@garikinarajesh1999 Yeah, what other way do you think you could do it short of telepathy. It's a computer program, you have to click something to interact with it.
Overwrite Grid Labels - Python Tkinter GUI Tutorial #42
9:16
Codemy.com
Рет қаралды 30 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 33 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 43 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 54 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
I use Drag and Drop to build modern Python Apps
14:08
Softlinks
Рет қаралды 88 М.
How to Pass Data between Multiple Windows in Tkinter
18:19
CodersLegacy
Рет қаралды 30 М.
Python Tkinter GUI Design Using ttkbootstrap - Complete Course
3:23:58
freeCodeCamp.org
Рет қаралды 347 М.
Learn Python tkinter labels easy 🏷️
10:28
Bro Code
Рет қаралды 44 М.
Tkinter Course - Create Graphic User Interfaces in Python Tutorial
5:37:31
freeCodeCamp.org
Рет қаралды 3,3 МЛН
Learn Python tkinter GUI buttons easy 🛎️
11:40
Bro Code
Рет қаралды 84 М.
Setting and getting widget data in tkinter
13:43
Atlas
Рет қаралды 12 М.
Radio Buttons with TKinter - Python Tkinter GUI Tutorial #12
17:44
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 33 МЛН