Using StringVar and textvariable with a Python tkinter label

  Рет қаралды 44,958

John Philip Jones

John Philip Jones

Күн бұрын

This lessons shows how the content of a variable can be 'linked' to a Python tkinter label, such that, whenever the variable is changed it is reflected in the label.

Пікірлер: 70
@briansosa1613
@briansosa1613 2 жыл бұрын
Ill be honest, this channel is one of the best clear tutorial ive ever seen.
@johnphilipjones
@johnphilipjones 2 жыл бұрын
Thank you. Best wishes Phil (John Philip Jones)
@ryantabeshi9565
@ryantabeshi9565 3 жыл бұрын
I had to stop this video halfway and just say thank you to a brilliant teacher
@johnphilipjones
@johnphilipjones 3 жыл бұрын
Thank you for the generous comment. Best wishes Phil
@orondavid4320
@orondavid4320 2 жыл бұрын
Thank you very much, the way you come to explain the material is simply ingenious
@raulcalimann7738
@raulcalimann7738 2 жыл бұрын
I have to say you are a great teacher and the way you repeated and pointed out evrey little line of code was implemented in a very good way . Thank you very much for this video !
@johnphilipjones
@johnphilipjones 2 жыл бұрын
Thank you for your positive comments it is appreciated. Best wishes Phil
@airpods4
@airpods4 6 жыл бұрын
I dunno why this channel is not famous yet, this video shows a great representation of this function especially for a slow learner like me and for some people who really wants to understand programming by not copy pasting code but understanding every each of them.
@johnphilipjones
@johnphilipjones 6 жыл бұрын
Thank you for the positive comments. Best wishes Phil
@nelsongg347
@nelsongg347 5 жыл бұрын
A master class on Stringvar(), and behind the scenes a master class of English for all of us that use English as a second language. Thanks John!!!
@Xardas_
@Xardas_ 2 жыл бұрын
We need more teachers like this. Thanks you !
@scition6139
@scition6139 2 жыл бұрын
Simple vid yet you can understand everything more clearly than all the fancy vids out there. I left a like.
@bishtss1
@bishtss1 6 жыл бұрын
Excellent way of teaching, animation makes the concept more clearer and easy to remember.
@billrose5146
@billrose5146 3 жыл бұрын
I needed a Tkinter refresher as I debug some existing complex code. This step-by-step discussion was just what I needed. Thanks.
@elonximperator892
@elonximperator892 3 жыл бұрын
I just subscribed your channel I mentioned this because I subscribe only few selected channels which have great quality of content
@CharlesSmall
@CharlesSmall 3 жыл бұрын
This is what i call - a very good teacher. Thank you.
@setzz69
@setzz69 4 жыл бұрын
You know a good teacher, when you see one; I am a doctor, trying to learn something different, and somehow I decided coding and then googling ended up with Python. I have read books on python and kept on practicing; I am doing tkinter now. I struggled with the concept of OOP; until I went through this clip by John Philip Jones- Simply brilliant. Thank you ever so much.
@johnphilipjones
@johnphilipjones 4 жыл бұрын
Thank you for your positive feedback it is appreciated. I am glad you like the video. Check out the supporting website where all videos are organised. See the link below: www.PythonByteSize.com Best wishes Phil
@isturizz
@isturizz 4 жыл бұрын
Soy hispanohablante y aun así logré entender la explicación, cosa que no había logrado en otros tutoriales y web en español. GRACIAS!
@johnphilipjones
@johnphilipjones 4 жыл бұрын
Thank you Best wishes Phil
@atharvnikhare7113
@atharvnikhare7113 3 жыл бұрын
thanks for clearing the concept!!!👌🙌🙌
@vladbalu6802
@vladbalu6802 3 жыл бұрын
Best Python tutorial ever! Thank you for spending time to teach others programming.
@johnphilipjones
@johnphilipjones 3 жыл бұрын
It is pleasing to know that the videos are helping Best wishes Phil
@mulandaafumba1677
@mulandaafumba1677 4 жыл бұрын
You're real teacher coder. Congrats
@KevinSmith-qt4hz
@KevinSmith-qt4hz 6 жыл бұрын
If only other people made videos like this, or you were insanely popular, many more people woud know how to code. This is perfect
@SergeGilette
@SergeGilette 4 ай бұрын
Great video, with very simple and clear explanations. Thanks ! You've got a subscriber !
@johnphilipjones
@johnphilipjones 4 ай бұрын
Thank you for your positive feedback it is appreciated. Best wishes Phil
@swagatbhowmik879
@swagatbhowmik879 4 жыл бұрын
Man truly fantastic explanation! Please make more videos like this. Every concept is crystal clear.
@judeleon8485
@judeleon8485 4 жыл бұрын
This is an excellent way of teaching. In fact, it's the best I have seen
@johnphilipjones
@johnphilipjones 4 жыл бұрын
Thank you for your positive feedback it is appreciated. Best wishes Phil
@spankowhat
@spankowhat 5 жыл бұрын
What a beast, simple animations, yet effective. Well done!
@funnyclips2696
@funnyclips2696 2 жыл бұрын
Excellent...
@patis.IA-AI
@patis.IA-AI Жыл бұрын
great teacher thanks top !!
@johnphilipjones
@johnphilipjones Жыл бұрын
Thank you! 😃
@TheArchaeus6
@TheArchaeus6 6 жыл бұрын
This is great. I can now replace loads of redundant code I used to change a label text. Much cleaner and functional. Thanks again.
@imedayari1
@imedayari1 6 жыл бұрын
very very very nice and great tuto, thank you for sharing
@saadsiddiqui9755
@saadsiddiqui9755 3 жыл бұрын
I truly love your videos. Thank you very much for all these great explanations.
@johnphilipjones
@johnphilipjones 3 жыл бұрын
Thank you for your positive feedback it is appreciated. Best wishes Phil
@itzikovadia851
@itzikovadia851 4 жыл бұрын
very impressing and professional thanks
@MaxGoddur
@MaxGoddur 6 жыл бұрын
Great to see you are diving into a deeper understanding of the code involving: var_1=StringVar() This line has confounded me ever since the first time it was introduced into the learning criteria. I am going back to re-watch this video till I understand it completely.
@moltebin
@moltebin Жыл бұрын
Good teacher
@johnphilipjones
@johnphilipjones Жыл бұрын
Thank you! 😃
@parthjangid3587
@parthjangid3587 4 жыл бұрын
You made is very easy to understand thank you sir!!
@marcdurand2617
@marcdurand2617 5 жыл бұрын
You explain VERY well, thank you
@abderahimmazouz2088
@abderahimmazouz2088 5 жыл бұрын
v= StringVar() v.set("THANK YOU")
@johnphilipjones
@johnphilipjones 5 жыл бұрын
😊👍
@deveshkumar6533
@deveshkumar6533 6 жыл бұрын
Your videos are really awesome ...please keep this good work .....
@mr.moonlight3000
@mr.moonlight3000 4 жыл бұрын
Thank you very much for this perfect video. It was exactly what I needed.
@IoniB
@IoniB 3 жыл бұрын
Thank you so much!!
@xpertutorialseo2
@xpertutorialseo2 5 жыл бұрын
very good explanation!
@baibars5191
@baibars5191 2 жыл бұрын
Thanks
@Maelzelmusic
@Maelzelmusic 5 жыл бұрын
Thank you very much sir
@aksharkashyap5492
@aksharkashyap5492 5 жыл бұрын
mind blowing
@Saveg36
@Saveg36 3 жыл бұрын
i get it now
@one_mega_ohm9139
@one_mega_ohm9139 4 жыл бұрын
Any tips if I am trying to get a constantly updating variable (voltage) to update on the tkinter GUI? Thanks to this video, I can get one instance of the variable to show up in the window (in replace of "Hi"), but I'd like it to update every 3 seconds or so. The normal code has delay = 3... time.sleep(delay)... at the end, but when I add the Tk GUI I think the my_window.mainloop() blocks the loop??
@johnphilipjones
@johnphilipjones 4 жыл бұрын
I would recommend using threads. Best wishes Phil
@neouia777
@neouia777 5 жыл бұрын
I am Arabic and my level in English is bed but i understand Thanks
@MaxGoddur
@MaxGoddur 6 жыл бұрын
Would this be a way to carry out this scenario? I have a Tkinter GUI program which searches for files by extension then copies them to the path requested. What would be great is everytime a file is found matching the criteria it would show up in the GUI box in some sort of text listing window. Would this be possible using the var_1=StringVar()? If so look forward to seeing how it is done if and when it is scheduled.
@johnphilipjones
@johnphilipjones 6 жыл бұрын
Will be covering techniques over the coming videos that will enable you to do this. Best wishes Phil
@techpal5525
@techpal5525 5 жыл бұрын
How to restrict an Entry box with characters? I only want users to put strictly 0-9 number . or.. how do I fix TclError, when a user puts a string in the Entry Box ?
@johnphilipjones
@johnphilipjones 5 жыл бұрын
I will do a video on how to do it. Best wishes Phil
@wallacesantos0
@wallacesantos0 5 жыл бұрын
Can we use StringVar in a font somehow? So we can change the fontsize of the entire program
@johnphilipjones
@johnphilipjones 5 жыл бұрын
Read in an integer from the GUI storing it in StringVar (convert to an integer). Then use this integer to set the font size attribute of the widget you require altering.Best wishesPhil
@la77y8
@la77y8 5 жыл бұрын
So, does the Python calculation loop go inside the tk window loop or does the tk window loop go inside the python calculation loop?
@johnphilipjones
@johnphilipjones 5 жыл бұрын
The calculation would go inside a function or method. The function (or method) would typically be bound to the click event of a button. The program when executing would enter the mainloop. A click on the button causes an event. The program would then execute the function bound to the button click event (i.e. the calculation). When the execution of the function is complete the program returns to executing the mainloop.
@la77y8
@la77y8 5 жыл бұрын
@@johnphilipjones Right, I understand that. I think I'm struggling with the GUI paradigm. window.mainloop() is waiting for an event. I want to read a sensor and update the text in a label. I can do that once with a button click. If I define a function that reads a sensor periodically, I don't see a clean way to trigger an event to update the label then read the sensor again. Thanks for the reply.
@johnphilipjones
@johnphilipjones 5 жыл бұрын
I would recommend that you use threads. Have the GUI in one thread and a timer in another thread. Every 'unit of time' read the sensor with an handler (method/function) that both reads the sensor and also updates the GUI. This is not easy as it involves an understanding of threads and communicating between threads. It is something I will eventually be covering but is will be quite a while off before I finish other topics but I will get around to it. Best wishes Phil
@hyperconnected9809
@hyperconnected9809 6 жыл бұрын
hey can help me with my tkinter im trying to display real time data.. please help
@johnphilipjones
@johnphilipjones 5 жыл бұрын
Could you supply me with more details of the specification? Best wishes Phil
@mh5854
@mh5854 3 жыл бұрын
thanks
The Python tkinter StringVar set() method
8:43
John Philip Jones
Рет қаралды 18 М.
tkinter events and mainloop()
16:08
John Philip Jones
Рет қаралды 60 М.
GTA 5 vs GTA San Andreas Doctors🥼🚑
00:57
Xzit Thamer
Рет қаралды 26 МЛН
هذه الحلوى قد تقتلني 😱🍬
00:22
Cool Tool SHORTS Arabic
Рет қаралды 93 МЛН
小丑和白天使的比试。#天使 #小丑 #超人不会飞
00:51
超人不会飞
Рет қаралды 35 МЛН
❌Разве такое возможно? #story
01:00
Кэри Найс
Рет қаралды 6 МЛН
Introduction to the Python tkinter button widget
11:10
John Philip Jones
Рет қаралды 14 М.
Fahrenheit to Celsius Python GUI
15:09
John Philip Jones
Рет қаралды 11 М.
Using the Python help function to assist with inheritance
18:10
John Philip Jones
Рет қаралды 5 М.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
pixegami
Рет қаралды 268 М.
Python Tkinter - StringVar in Entry Widget and Common Mistakes
15:43
Thinking Through Code
Рет қаралды 3,5 М.
How to Inherit from a Python tkinter Frame
31:12
John Philip Jones
Рет қаралды 25 М.
Understanding tkinter variables
11:48
Atlas
Рет қаралды 10 М.
Modern Python logging
21:32
mCoding
Рет қаралды 182 М.
The Python tkinter keys() method for a label
9:07
John Philip Jones
Рет қаралды 10 М.
How to place a Python tkinter window in the center of the screen
15:49
John Philip Jones
Рет қаралды 29 М.
GTA 5 vs GTA San Andreas Doctors🥼🚑
00:57
Xzit Thamer
Рет қаралды 26 МЛН