Tkinter Basics 5: Dialog and Message Boxes

  Рет қаралды 1,901

Alan D Moore Codes

Alan D Moore Codes

3 жыл бұрын

Learn how easy it is to use Tkinter and Python to build simple GUI applications with author Alan D Moore.
Example code for this video can be found here: github.com/alandmoore/tkinter...
Check out Python GUI Programming with Tkinter, 2nd Edition: www.amazon.com/Python-GUI-Pro...

Пікірлер: 13
@fletcherthompson404
@fletcherthompson404 2 жыл бұрын
These videos are criminally underviewed. You took the mystery out of tkinter programming for me, and did in much the same way that Bob Ross paints a picture. Thanks Alan!
@anurasenarathna1703
@anurasenarathna1703 2 жыл бұрын
Very good series. Learning from a real expert. Thank you very much.
@Xaveth
@Xaveth 3 жыл бұрын
Thank you Alan! Loving this series of videos. Just FYI, I typed "Test" as my message, checked Private, and was getting an error: "'charmap' codec can't encode characters in position 0-4: character maps to . So, I did some Googling and fixed it using this: with open(filename, "w", encoding="utf-8") as fh: fh.write(message) (using Python 3.9.1 and PyCharm2020.3.4) Thank you for all of your amazing videos! I hope you continue doing more of these.
@alandmoorecodes3585
@alandmoorecodes3585 3 жыл бұрын
Ah yes, thanks; I forget that utf-8 is not default on all platforms. Which OS are you on, so everyone else knows?
@Xaveth
@Xaveth 3 жыл бұрын
@@alandmoorecodes3585 Windows 10 64-bit. Thank you sir!
@Xaveth
@Xaveth 3 жыл бұрын
@@alandmoorecodes3585 You really should try this code on a Win 10 machine. If the offset numerical value is very low (i.e. I manually set offset = 1) then weaksauce decode works perfectly; however, anything much higher for that offset value (as in the case of summing the values of the password), and decode will print nothing. I'm not sure if it's because tkinter isn't file-reading the utf-8 characters or what's going on. But yeh, not working on my setup: Win 10 64-bit, Python 3.9.1, and PyCharm2020.3.4
@muddledlindy73
@muddledlindy73 2 жыл бұрын
@@Xaveth Have you tried specifying the encoding when reading the file back in? I just modified the read_text() call to be: message = fp.read_text(encoding='utf-8')
@Xaveth
@Xaveth 3 жыл бұрын
Sorry, one more note Alan. Did you notice how it took a mouse rollover to make the checkmark go to uncheck on your video @10:13? I was noticing that on my end as well when I hit cancel. The checkbox value would be False, but the check would remain. I did a lot of Google searching for this and came up with solution to the code: def private_warn (*_args): ... if not response: root.after(1, private_var.set, False) Oh, and I'm using an underscore before "args" so that PyCharm doesn't give me a Parameter 'args' value is not used notice.
@alandmoorecodes3585
@alandmoorecodes3585 3 жыл бұрын
Great stuff! after() is often needed in this way, I should probably do a video about it. Almost included it in the bind video, but it was too much. Good point about the underscore. I often just use *_ in real code, but I thought it looked too much like "magic code" for pedagogical purposes.
@MajorMichael
@MajorMichael 3 жыл бұрын
I too was looking into that, and only saw that making any .configure() call would rerender the control. The problem is that configure() seems a little heavy, and you need to set a property that doesn't do anything, like wraplength or something. I was thinking that maybe an .after(1, ... call seems a little "magic". and found that this seems to work as well: ... root.after_idle(prv_var.set, False) Honestly, it is probably just an alias to the same thing as a 1ms(+) delay.
@MajorMichael
@MajorMichael 3 жыл бұрын
Also... having to re-configure any and all controls that are bound to the var is a fragile solution, as evidenced by the second binding to this var using the menus in your next video. Alan -- Thank you so much for making this series - I found you through your fireside chat about PyQt5 vs. Tkinter, and I have been hooked all weekend on your videos. Great work!
@rckeith
@rckeith 3 жыл бұрын
Thanks😀
@alandmoorecodes3585
@alandmoorecodes3585 3 жыл бұрын
Welcome!
Tkinter Basics 6: Application Menus
22:59
Alan D Moore Codes
Рет қаралды 1,3 М.
Tkinter Basics 10: Binding Events
23:35
Alan D Moore Codes
Рет қаралды 3,3 М.
Heartwarming: Stranger Saves Puppy from Hot Car #shorts
00:22
Fabiosa Best Lifehacks
Рет қаралды 21 МЛН
Did you believe it was real? #tiktok
00:25
Анастасия Тарасова
Рет қаралды 53 МЛН
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
Khó thế mà cũng làm được || How did the police do that? #shorts
01:00
Tkinter Basics 1: Setup, Widgets, and Geometry managers
26:00
Alan D Moore Codes
Рет қаралды 9 М.
Concurrency in Go
18:40
Jake Wright
Рет қаралды 609 М.
Tkinter vs. PyQt:  Which Python GUI framework is right for you?
38:11
Alan D Moore Codes
Рет қаралды 64 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 372 М.
Tkinter Basics 8: Ttk part 2 - The Treeview Widget
24:25
Alan D Moore Codes
Рет қаралды 2,3 М.
Master Python With This ONE Project!
56:54
Tech With Tim
Рет қаралды 13 М.
Giant numbers
7:27
stuff | An abridged guide to interesting things
Рет қаралды 10 М.
Зачем ЭТО электрику? #секрет #прибор #энерголикбез
0:56
Александр Мальков
Рет қаралды 57 М.
Как правильно выключать звук на телефоне?
0:17
Люди.Идеи, общественная организация
Рет қаралды 727 М.
Battery  low 🔋 🪫
0:10
dednahype
Рет қаралды 414 М.