title
Learn to Program 20 : TkInter Tutorial
description
Code & Transcript : http://goo.gl/2cmB2V
Best Python Book : http://amzn.to/2aapV6S
Support me on Patreon : https://www.patreon.com/derekbanas
In this part of my Learn to Program series I'll start a multi-part tutorial on developing GUI interfaces with TkInter and Python. We'll look at root, Ttk, Button, Entry, Label, Frame, Checkbutton, TkInter Event Handling, mainLoop(), StringVar, the Pack Geometry Manager, the Grid Geometry Manager and more.
If you missed any of the previous videos, the series starts here : https://www.youtube.com/playlist?list=PLGLfVvz_LVvTn3cK5e6LjhgGiSeVlIRwt
Thank you to Patreon supports like the following for helping me make this video
https://www.facebook.com/cottageindustriesbuild/
@kyleaisho
@thetwistedhat
vjFaLk
detail
{'title': 'Learn to Program 20 : TkInter Tutorial', 'heatmap': [], 'summary': 'Learn to program 20: tkinter tutorial covers introduction to tkinter for python interfaces, pack and grid geometry managers, creating user interface and layout design, interface design and gui creation, and creating a sum calculator using tk inter.', 'chapters': [{'end': 381.366, 'segs': [{'end': 59.137, 'src': 'embed', 'start': 21.935, 'weight': 0, 'content': [{'end': 29.682, 'text': "And TK is a cross-platform GUI toolkit that's going to provide things called widgets, which, in the actual real world,", 'start': 21.935, 'duration': 7.747}, {'end': 34.467, 'text': "are things like buttons and scroll bars and things like that that we're going to use to build our interfaces.", 'start': 29.682, 'duration': 4.785}, {'end': 41.09, 'text': 'And TkEnter in particular is a Python interface that is going to be able to work with Tk.', 'start': 34.827, 'duration': 6.263}, {'end': 50.333, 'text': "And another awesome thing about TkEnter is it's going to be included for all versions of Python 3.1 and above, for both Macs and Windows,", 'start': 41.31, 'duration': 9.023}, {'end': 51.874, 'text': 'as well as on Linux.', 'start': 50.333, 'duration': 1.541}, {'end': 57.036, 'text': "And if you haven't watched previous parts of the tutorial, I provide a link in the description.", 'start': 52.494, 'duration': 4.542}, {'end': 59.137, 'text': "And I have a lot to do, so let's get into it.", 'start': 57.296, 'duration': 1.841}], 'summary': 'Tkenter is a cross-platform gui toolkit for python, included for all versions of python 3.1 and above, for macs, windows, and linux.', 'duration': 37.202, 'max_score': 21.935, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU21935.jpg'}, {'end': 107.079, 'src': 'embed', 'start': 79.505, 'weight': 4, 'content': [{'end': 83.367, 'text': "And if you see that, you know everything's wonderful and everything's working and so forth and so on.", 'start': 79.505, 'duration': 3.862}, {'end': 84.367, 'text': 'So you can close that.', 'start': 83.407, 'duration': 0.96}, {'end': 88.91, 'text': "Now what we're going to do is we're going to import some modules we have here.", 'start': 84.628, 'duration': 4.282}, {'end': 96.113, 'text': "And so I'm going to go tk enter, and I'm just going to import everything just to keep everything nice and simple.", 'start': 89.57, 'duration': 6.543}, {'end': 101.236, 'text': "And then I'm going to go from tk enter, import ttk.", 'start': 96.414, 'duration': 4.822}, {'end': 103.997, 'text': "All right, so we have the modules that we're going to need.", 'start': 101.476, 'duration': 2.521}, {'end': 107.079, 'text': "And why don't I just go and do a simple hello world thing.", 'start': 104.358, 'duration': 2.721}], 'summary': 'Imported modules and implemented simple hello world program using tkinter.', 'duration': 27.574, 'max_score': 79.505, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU79505.jpg'}, {'end': 149.888, 'src': 'embed', 'start': 121.502, 'weight': 3, 'content': [{'end': 124.463, 'text': "It doesn't have to be called root, but it's very common that everybody calls it root.", 'start': 121.502, 'duration': 2.961}, {'end': 129.003, 'text': "And let's say that we want to come in here and give our window a title.", 'start': 124.903, 'duration': 4.1}, {'end': 133.025, 'text': 'We can just go something like first GUI like that.', 'start': 129.324, 'duration': 3.701}, {'end': 138.566, 'text': "And let's say we want to put a window in or a button inside of our window.", 'start': 134.045, 'duration': 4.521}, {'end': 139.546, 'text': 'We can do that as well.', 'start': 138.626, 'duration': 0.92}, {'end': 144.907, 'text': 'We just go TTK and button like this and roots.', 'start': 139.586, 'duration': 5.321}, {'end': 149.888, 'text': "And there's a whole bunch of different ways to add components, change components, do all kinds of things with components.", 'start': 145.568, 'duration': 4.32}], 'summary': 'Introduction to gui programming with ttk components and window customization.', 'duration': 28.386, 'max_score': 121.502, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU121502.jpg'}, {'end': 210.81, 'src': 'embed', 'start': 186.996, 'weight': 2, 'content': [{'end': 197.502, 'text': "You can see there, first GUI, there's where we set the title, Okay, so that is our first entry into the world of TkEnter.", 'start': 186.996, 'duration': 10.506}, {'end': 204.206, 'text': "And if you're wondering about all the different components that are available, you're going to see here are a whole bunch of different components.", 'start': 197.922, 'duration': 6.284}, {'end': 210.81, 'text': 'We have buttons and labels and canvases and menus and menu buttons and radio buttons and a whole bunch of other different things,', 'start': 204.246, 'duration': 6.564}], 'summary': 'Introduction to tkenter with various components.', 'duration': 23.814, 'max_score': 186.996, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU186996.jpg'}], 'start': 0.149, 'title': 'Introduction to tkinter for python interfaces', 'summary': 'Introduces tkinter as a cross-platform gui toolkit for python, highlighting its compatibility with python 3.1 and above for mac, windows, and linux. it also covers the basics of tkinter gui, including components like frames, labels, and buttons, demonstrated through a simple example.', 'chapters': [{'end': 59.137, 'start': 0.149, 'title': 'Introduction to tkinter for python interfaces', 'summary': "Introduces tkinter as a cross-platform gui toolkit for python, providing widgets to create graphical user interfaces. it highlights tkinter's compatibility with python 3.1 and above for mac, windows, and linux.", 'duration': 58.988, 'highlights': ['TKinter is a cross-platform GUI toolkit that provides widgets such as buttons and scroll bars for building interfaces. It introduces TKinter as a cross-platform GUI toolkit that provides widgets like buttons and scroll bars for building interfaces.', 'TKinter is included for all versions of Python 3.1 and above, for both Macs and Windows, as well as on Linux. It mentions that TKinter is included for all versions of Python 3.1 and above, for both Macs and Windows, as well as on Linux.']}, {'end': 186.815, 'start': 59.898, 'title': 'Tkenter gui development', 'summary': 'Introduces tkenter and demonstrates creating a simple gui with a button and a window, and running the main loop.', 'duration': 126.917, 'highlights': ["Creating a TKEnter object named root and giving it the title 'first GUI' before adding a TTK button with the text 'hello, TK, enter'.", "Importing TKEnter and testing its functionality by running a simple test to verify that it's working properly.", 'Importing modules including TKEnter and ttk to be used in the GUI development.']}, {'end': 381.366, 'start': 186.996, 'title': 'Introduction to tkinter gui', 'summary': "Introduces the basics of tkinter gui, including the use of components such as frames, labels, and buttons and how to manipulate their attributes and text content, demonstrated through a simple example. a window is displayed with a label saying 'i am a label' and a button labeled 'click me'.", 'duration': 194.37, 'highlights': ['The chapter introduces the basics of Tkinter GUI, including the use of components such as frames, labels, and buttons and how to manipulate their attributes and text content, demonstrated through a simple example.', "A window is displayed with a label saying 'I am a label' and a button labeled 'click me'.", 'The tutorial covers the use of Tkinter variables to change the text for label components.']}], 'duration': 381.217, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU149.jpg', 'highlights': ['TKinter is included for all versions of Python 3.1 and above, for both Macs and Windows, as well as on Linux.', 'Introduces TKinter as a cross-platform GUI toolkit that provides widgets like buttons and scroll bars for building interfaces.', 'The chapter introduces the basics of Tkinter GUI, including the use of components such as frames, labels, and buttons and how to manipulate their attributes and text content, demonstrated through a simple example.', "Creating a TKEnter object named root and giving it the title 'first GUI' before adding a TTK button with the text 'hello, TK, enter'.", 'Importing modules including TKEnter and ttk to be used in the GUI development.']}, {'end': 705.648, 'segs': [{'end': 427.166, 'src': 'embed', 'start': 381.667, 'weight': 1, 'content': [{'end': 388.654, 'text': 'So now what I want to do is jump in and talk more precisely about how the Pack Geometry Manager is going to work for us.', 'start': 381.667, 'duration': 6.987}, {'end': 393.542, 'text': 'Now pack is a very simplistic geometry manager.', 'start': 389.656, 'duration': 3.886}, {'end': 399.672, 'text': 'And all that means is it defines how all of your components are going to be laid out inside of the window you create.', 'start': 393.602, 'duration': 6.07}, {'end': 402.457, 'text': "So geometry manager sounds complicated, but that's what it does.", 'start': 399.772, 'duration': 2.685}, {'end': 413.18, 'text': 'and pack, specifically, is going to position widgets by allowing them to define their position, so things like top and right,', 'start': 402.896, 'duration': 10.284}, {'end': 420.844, 'text': 'and bottom and left inside of the window, also in comparison to other components that are inside of there,', 'start': 413.18, 'duration': 7.664}, {'end': 427.166, 'text': "and it's also going to allow them to define their fill direction, which means how they will be stretched into the window,", 'start': 420.844, 'duration': 6.322}], 'summary': 'Pack geometry manager positions widgets in window, defining position and fill direction.', 'duration': 45.499, 'max_score': 381.667, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU381667.jpg'}, {'end': 626.916, 'src': 'embed', 'start': 597.906, 'weight': 0, 'content': [{'end': 603.554, 'text': "What, however, is used a lot is the grid geometry manager, and we're going to look at that next.", 'start': 597.906, 'duration': 5.648}, {'end': 610.251, 'text': 'Now the grid manager is the most useful of all the different geometry managers that we have here.', 'start': 604.349, 'duration': 5.902}, {'end': 618.533, 'text': 'And basically what it does is it lines up widgets on your screen in using rows and columns like a table or a matrix.', 'start': 610.531, 'duration': 8.002}, {'end': 621.294, 'text': "And I'm actually going to create two of these guys.", 'start': 618.973, 'duration': 2.321}, {'end': 626.916, 'text': "So, basically, what's going to happen is each cell is going to be able to hold one widget,", 'start': 621.574, 'duration': 5.342}], 'summary': 'Grid manager organizes widgets in rows and columns, most useful geometry manager.', 'duration': 29.01, 'max_score': 597.906, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU597906.jpg'}], 'start': 381.667, 'title': "Tkinter's pack and grid geometry managers", 'summary': "Covers the functionality of tkinter's pack geometry manager for simplifying component positioning, as well as introduces python gui's pack and grid layout managers, demonstrating widget positioning and layout with examples.", 'chapters': [{'end': 427.166, 'start': 381.667, 'title': 'Pack geometry manager in tkinter', 'summary': 'Outlines the functionality of the pack geometry manager in tkinter, which simplistically defines the positioning and layout of components inside a window, including their relative positioning and fill direction.', 'duration': 45.499, 'highlights': ['The Pack Geometry Manager defines the positioning and layout of components inside a window, including relative positioning and fill direction.', 'It allows widgets to define their position in terms of top, right, bottom, and left inside the window.', 'It also enables widgets to define their fill direction, determining how they will be stretched into the window.']}, {'end': 705.648, 'start': 427.166, 'title': 'Python gui layout managers', 'summary': 'Introduces the pack and grid layout managers in python gui, demonstrating their usage and positioning widgets in the x and y directions, with examples of how to position buttons and labels using the pack manager, and defining rows and columns using the grid manager.', 'duration': 278.482, 'highlights': ['The pack geometry manager is demonstrated, positioning widgets in the X and Y directions, with examples of how to position buttons using the pack manager. The pack geometry manager is demonstrated, positioning widgets in the X and Y directions, with examples of how to position buttons using the pack manager.', 'The grid geometry manager is explained, demonstrating the positioning of widgets in rows and columns like a table or a matrix, with an example of how to position a label using the grid manager. The grid geometry manager is explained, demonstrating the positioning of widgets in rows and columns like a table or a matrix, with an example of how to position a label using the grid manager.']}], 'duration': 323.981, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU381667.jpg', 'highlights': ['The grid geometry manager is explained, demonstrating the positioning of widgets in rows and columns like a table or a matrix, with an example of how to position a label using the grid manager.', 'The Pack Geometry Manager defines the positioning and layout of components inside a window, including relative positioning and fill direction.', 'It allows widgets to define their position in terms of top, right, bottom, and left inside the window.', 'The pack geometry manager is demonstrated, positioning widgets in the X and Y directions, with examples of how to position buttons using the pack manager.']}, {'end': 944.295, 'segs': [{'end': 738.439, 'src': 'embed', 'start': 705.648, 'weight': 4, 'content': [{'end': 707.789, 'text': 'and then you could also come in and put padding.', 'start': 705.648, 'duration': 2.141}, {'end': 710.67, 'text': "there's a whole bunch of different attributes that are available.", 'start': 707.789, 'duration': 2.881}, {'end': 712.63, 'text': "I'm just gonna keep a little bit simple here, though.", 'start': 710.67, 'duration': 1.96}, {'end': 717.732, 'text': "so I'm gonna say the padding around this component or widget is going to be 4 pixels,", 'start': 712.63, 'duration': 5.102}, {'end': 726.075, 'text': "and then let's come in and let's say if we want the user to be able to enter information, we're going to use the entry widget for that,", 'start': 717.732, 'duration': 8.343}, {'end': 732.417, 'text': 'and we can say grid, and this is going to be on the same row as we did with our label.', 'start': 726.075, 'duration': 6.342}, {'end': 738.439, 'text': 'We are, however, going to put it in the second column, which is going to be the number one column.', 'start': 732.797, 'duration': 5.642}], 'summary': 'Setting padding to 4 pixels and using entry widget for user input in grid layout.', 'duration': 32.791, 'max_score': 705.648, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU705648.jpg'}, {'end': 800.936, 'src': 'embed', 'start': 773.888, 'weight': 3, 'content': [{'end': 777.389, 'text': "This is going to be the second column, so we'll leave it exactly like that.", 'start': 773.888, 'duration': 3.501}, {'end': 782.07, 'text': "And then let's say after that we decide we want to throw a button on the screen.", 'start': 777.729, 'duration': 4.341}, {'end': 785.31, 'text': "We can say button root is what's going to contain it.", 'start': 782.09, 'duration': 3.22}, {'end': 790.571, 'text': "And let's say we want the text on this button that's going to show up to be submit.", 'start': 786.03, 'duration': 4.541}, {'end': 794.192, 'text': "And then we'll come in here and do grid again.", 'start': 790.911, 'duration': 3.281}, {'end': 798.213, 'text': "And we'll say that this is going to be on the third row.", 'start': 794.772, 'duration': 3.441}, {'end': 800.936, 'text': 'And we can do all that different stuff and run it.', 'start': 798.593, 'duration': 2.343}], 'summary': "Adding a button to the second column, with 'submit' as the text.", 'duration': 27.048, 'max_score': 773.888, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU773888.jpg'}, {'end': 840.636, 'src': 'embed', 'start': 812.87, 'weight': 0, 'content': [{'end': 818.276, 'text': 'Now what I want to do is to create a little bit more complicated type of design.', 'start': 812.87, 'duration': 5.406}, {'end': 825.903, 'text': "And this layout is going to have a label and then an entry on the right side of it that's going to be 50 pixels in width.", 'start': 818.936, 'duration': 6.967}, {'end': 828.906, 'text': 'You can also define the pixels for all of your widgets.', 'start': 826.203, 'duration': 2.703}, {'end': 833.13, 'text': "It's then going to have a button on the right side and then underneath that.", 'start': 829.326, 'duration': 3.804}, {'end': 840.636, 'text': "what we're going to do is have a label followed by a bunch of radio buttons and then on the right side of that label with the radio buttons,", 'start': 833.13, 'duration': 7.506}], 'summary': 'Create a layout with label, entry, and button, while defining widget sizes.', 'duration': 27.766, 'max_score': 812.87, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU812870.jpg'}, {'end': 900.097, 'src': 'embed', 'start': 874.201, 'weight': 2, 'content': [{'end': 879.705, 'text': "And then we want this to be on the west side of the screen, so we'll say sticky and west.", 'start': 874.201, 'duration': 5.504}, {'end': 886.129, 'text': "And then we decided that we wanted to have an entry box that they could enter information in, so we'll go root.", 'start': 879.945, 'duration': 6.184}, {'end': 891.132, 'text': "We said we wanted it to be 50 pixels in width, so we'll set that to 50.", 'start': 886.349, 'duration': 4.783}, {'end': 894.794, 'text': "Go into grid and find how that's going to be positioned.", 'start': 891.132, 'duration': 3.662}, {'end': 898.436, 'text': "So it's going to be once again on the same row as our label.", 'start': 894.874, 'duration': 3.562}, {'end': 900.097, 'text': "So we'll have that be zero.", 'start': 898.537, 'duration': 1.56}], 'summary': 'Designing ui with a sticky west element and 50-pixel-wide entry box.', 'duration': 25.896, 'max_score': 874.201, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU874201.jpg'}], 'start': 705.648, 'title': 'Creating user interface and layout design', 'summary': 'Discusses creating a user interface with padding and widgets, specifying padding size, positioning widgets in rows and columns, and adding a submit button. it also demonstrates creating a layout with label, entry, and button widgets positioned using the grid method, with the entry widget set to 50 pixels in width.', 'chapters': [{'end': 812.649, 'start': 705.648, 'title': 'Creating user interface with padding and widgets', 'summary': 'Discusses creating a user interface using padding and widgets, specifying padding size, positioning widgets in rows and columns, and adding a submit button.', 'duration': 107.001, 'highlights': ['Specifying padding around components or widgets to be 4 pixels The speaker specifies the padding around the component or widget to be 4 pixels, demonstrating the use of padding attributes.', "Positioning an 'entry' widget in the second column with sticky alignment to the east The 'entry' widget is positioned in the second column with sticky alignment to the east, illustrating widget positioning and alignment.", "Adding a submit button with the text 'submit' and positioning it in the third row A submit button with the text 'submit' is added and positioned in the third row, demonstrating the addition of a button widget and its positioning."]}, {'end': 944.295, 'start': 812.87, 'title': 'Creating complicated layout design', 'summary': 'Demonstrates creating a layout with label, entry, and button widgets positioned using the grid method, with the entry widget set to 50 pixels in width.', 'duration': 131.425, 'highlights': ['Creating layout with label, entry, and button widgets using grid method Demonstrates creating a layout with label, entry, and button widgets using the grid method to position them on the screen.', 'Setting entry widget to 50 pixels in width Specifies setting the entry widget to 50 pixels in width, providing a specific dimension to the widget.']}], 'duration': 238.647, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU705648.jpg', 'highlights': ['Demonstrates creating a layout with label, entry, and button widgets using the grid method to position them on the screen.', 'Specifies setting the entry widget to 50 pixels in width, providing a specific dimension to the widget.', "The 'entry' widget is positioned in the second column with sticky alignment to the east, illustrating widget positioning and alignment.", "A submit button with the text 'submit' is added and positioned in the third row, demonstrating the addition of a button widget and its positioning.", 'The speaker specifies the padding around the component or widget to be 4 pixels, demonstrating the use of padding attributes.']}, {'end': 1274.646, 'segs': [{'end': 986.056, 'src': 'embed', 'start': 944.295, 'weight': 0, 'content': [{'end': 946.617, 'text': 'Remember, these are always supposed to be uppercase letters.', 'start': 944.295, 'duration': 2.322}, {'end': 948.938, 'text': "I should remember that, but I don't sometimes.", 'start': 946.857, 'duration': 2.081}, {'end': 954.741, 'text': "And when I run it, you can see right there, description, and then there's the entry box and the submit button.", 'start': 949.418, 'duration': 5.323}, {'end': 961.764, 'text': "And whenever I'm designing interfaces, well first off I draw them with paper and pencil and then go and create them from there.", 'start': 955.041, 'duration': 6.723}, {'end': 968.287, 'text': 'But we also would benefit greatly by just going and creating each row of the interface one by one.', 'start': 962.044, 'duration': 6.243}, {'end': 971.248, 'text': "Don't try to do it all at once, otherwise it might get confusing.", 'start': 968.327, 'duration': 2.921}, {'end': 979.072, 'text': 'All right, so now what do we want to do? Well, we want to have a label, and then we want to have a bunch of radio buttons underneath it.', 'start': 971.528, 'duration': 7.544}, {'end': 986.056, 'text': "So we're going to create our label, and we're going to have something like our quality.", 'start': 979.192, 'duration': 6.864}], 'summary': 'Designing interfaces: start with paper, then create each row separately.', 'duration': 41.761, 'max_score': 944.295, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU944295.jpg'}, {'end': 1058.813, 'src': 'embed', 'start': 1031.844, 'weight': 2, 'content': [{'end': 1037.685, 'text': "And then we're going to, let's say we wanted to give it a value so that we know which radio button was clicked on.", 'start': 1031.844, 'duration': 5.841}, {'end': 1041.726, 'text': 'We could say value one and then define our grid.', 'start': 1037.746, 'duration': 3.98}, {'end': 1044.847, 'text': 'We want this underneath of the label.', 'start': 1041.986, 'duration': 2.861}, {'end': 1048.387, 'text': "So we're going to define our row is going to be equal to two.", 'start': 1044.887, 'duration': 3.5}, {'end': 1052.309, 'text': 'And we want this in the same column as our label.', 'start': 1048.968, 'duration': 3.341}, {'end': 1054.009, 'text': "So we'll have that also be zero.", 'start': 1052.369, 'duration': 1.64}, {'end': 1058.813, 'text': 'And so that everything lines up, sticky is going to be equal to West.', 'start': 1054.409, 'duration': 4.404}], 'summary': 'Defining grid layout with value one, row two, and column zero.', 'duration': 26.969, 'max_score': 1031.844, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU1031844.jpg'}, {'end': 1263.339, 'src': 'embed', 'start': 1234.752, 'weight': 3, 'content': [{'end': 1239.657, 'text': "And it's just a matter of figuring out what rows and boxes everything needs to go into.", 'start': 1234.752, 'duration': 4.905}, {'end': 1244.782, 'text': "Now as the last part of the tutorial, I'm going to show you how events work with TK enter.", 'start': 1239.917, 'duration': 4.865}, {'end': 1253.33, 'text': "So I am going to create outside of this little box area, a function that's going to be called whenever a button is going to be clicked on.", 'start': 1245.062, 'duration': 8.268}, {'end': 1255.453, 'text': "And it's going to be called getSum.", 'start': 1253.772, 'duration': 1.681}, {'end': 1263.339, 'text': 'And some event information is going to be clicked or passed into this function any time an item is clicked on.', 'start': 1255.994, 'duration': 7.345}], 'summary': 'Tutorial on handling events with tk enter and creating a getsum function', 'duration': 28.587, 'max_score': 1234.752, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU1234752.jpg'}], 'start': 944.295, 'title': 'Interface design and gui creation', 'summary': 'Covers interface design tips including using uppercase letters, row-by-row design, grid placement for labels and radio buttons, and creating gui interfaces with tk by adding labels, check buttons, handling events, and achieving desired layout and functionality.', 'chapters': [{'end': 1079.329, 'start': 944.295, 'title': 'Interface design tips', 'summary': 'Discusses the importance of uppercase letters, designing interfaces one row at a time to avoid confusion, and the process of creating labels and radio buttons using grid placement in python, with an emphasis on simplicity and clarity.', 'duration': 135.034, 'highlights': ['The importance of using uppercase letters for interfaces and the process of designing them using paper and pencil before creating them (3 instances)', 'The recommended approach of creating each row of the interface one by one to avoid confusion (1 instance)', 'The process of creating labels and radio buttons using grid placement in Python, emphasizing simplicity and clarity (3 instances)']}, {'end': 1274.646, 'start': 1079.329, 'title': 'Creating gui interface with tk', 'summary': 'Explores creating a gui interface with tk, involving changing rows and columns, adding labels, check buttons, and handling events, to achieve the desired layout and functionality.', 'duration': 195.317, 'highlights': ['The process involves changing rows and columns to position elements, such as changing rows to 3, 2, and 1 and increasing the column by one to achieve the desired layout.', "Adding labels and check buttons, such as adding a label with 'benefits' text and check buttons for 'free shipping' and 'bonus gift' options to the interface.", "Demonstrating event handling by creating a function 'getSum' to be called when a button is clicked, showcasing the functionality of TK's event handling."]}], 'duration': 330.351, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU944295.jpg', 'highlights': ['Creating each row of the interface one by one to avoid confusion', 'Using uppercase letters for interfaces and designing them using paper and pencil', 'Creating labels and radio buttons using grid placement in Python', "Demonstrating event handling by creating a function 'getSum' to be called when a button is clicked", 'Adding labels and check buttons to the interface']}, {'end': 1538.963, 'segs': [{'end': 1333.598, 'src': 'embed', 'start': 1275.006, 'weight': 3, 'content': [{'end': 1278.669, 'text': "And then what we're going to do is we are going to create some entries.", 'start': 1275.006, 'duration': 3.663}, {'end': 1282.371, 'text': "So I'm going to call this num1 entry is equal to.", 'start': 1278.689, 'duration': 3.682}, {'end': 1290.997, 'text': 'And if I want to be able to get access to the information that is stored inside of these entries, I cannot put grid at the end.', 'start': 1282.711, 'duration': 8.286}, {'end': 1295.46, 'text': "I have to add the positioning elements afterwards, as I'm going to show here in a second.", 'start': 1291.117, 'duration': 4.343}, {'end': 1300.642, 'text': 'So I could say something like entry and root like that, and then, if I do that,', 'start': 1295.74, 'duration': 4.902}, {'end': 1305.704, 'text': "I'll be able to reference this and grab information out of the widget later on.", 'start': 1300.642, 'duration': 5.062}, {'end': 1311.486, 'text': "So then I'm going to go num1 entry and I'm just going to use pack here just to keep it nice and simple.", 'start': 1305.864, 'duration': 5.622}, {'end': 1316.368, 'text': "so I'll say that I want this to be on the left side and let's go and do a couple more.", 'start': 1311.486, 'duration': 4.882}, {'end': 1323.811, 'text': 'and all this is going to do is take two values entered in the entries and sum them and then update the interface.', 'start': 1316.368, 'duration': 7.443}, {'end': 1327.073, 'text': "I'm also going to put a label inside of here.", 'start': 1324.111, 'duration': 2.962}, {'end': 1333.598, 'text': "In this situation, I have no reason to change the text inside of the label, so I'm just going to leave it the way that it is and it's going to have,", 'start': 1327.433, 'duration': 6.165}], 'summary': 'Creating entries and widgets for interface, performing sum calculation.', 'duration': 58.592, 'max_score': 1275.006, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU1275006.jpg'}, {'end': 1383.359, 'src': 'embed', 'start': 1356.796, 'weight': 5, 'content': [{'end': 1361.7, 'text': "So I'll just call this equal button like that and create our button.", 'start': 1356.796, 'duration': 4.904}, {'end': 1368.426, 'text': "And here, just text is equal to and I'll put an equal sign inside of there.", 'start': 1362.561, 'duration': 5.865}, {'end': 1373.891, 'text': 'And then I want to bind an event handler to our button.', 'start': 1368.746, 'duration': 5.145}, {'end': 1383.359, 'text': "And now what I want to do is bind the left mouse button whenever it's clicked that it is going to actually call this function and execute it up here.", 'start': 1374.051, 'duration': 9.308}], 'summary': 'Creating an equal button with text and event handler for left mouse click.', 'duration': 26.563, 'max_score': 1356.796, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU1356796.jpg'}, {'end': 1452.924, 'src': 'embed', 'start': 1427.822, 'weight': 1, 'content': [{'end': 1434.644, 'text': "And now we'll go up into our function and actually define what exactly is going to be changing whenever the button is clicked on.", 'start': 1427.822, 'duration': 6.822}, {'end': 1442.893, 'text': "If I want to get the value that was input by the user in the entry, I can just go num1, and it's going to be a string.", 'start': 1434.904, 'duration': 7.989}, {'end': 1452.924, 'text': "so I'm going to convert it into an integer and I can go num1 entry like this and then get like that, and let's do exactly the same thing for num2..", 'start': 1442.893, 'duration': 10.031}], 'summary': 'Defining changes in function when button is clicked, converting input to integer.', 'duration': 25.102, 'max_score': 1427.822, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU1427822.jpg'}, {'end': 1538.963, 'src': 'embed', 'start': 1484.711, 'weight': 0, 'content': [{'end': 1491.814, 'text': "you're going to see this little guy pops up inside of here and we'll be able to come in and do something like three and four and equals.", 'start': 1484.711, 'duration': 7.103}, {'end': 1495.816, 'text': "However, if I do something like five like that, you're going to get a surprise.", 'start': 1492.074, 'duration': 3.742}, {'end': 1496.996, 'text': 'Oh, look at that.', 'start': 1495.996, 'duration': 1}, {'end': 1499.577, 'text': 'It went and added them up, but it put that inside the text box.', 'start': 1497.076, 'duration': 2.501}, {'end': 1500.838, 'text': "So let's go and correct that.", 'start': 1499.617, 'duration': 1.221}, {'end': 1512.588, 'text': 'how we can delete the value inside of there is just go sum entry once again and we go delete and pass zero inside of there and then end and run it again.', 'start': 1501.158, 'duration': 11.43}, {'end': 1513.949, 'text': 'and here we are.', 'start': 1512.588, 'duration': 1.361}, {'end': 1521.995, 'text': 'and now we can use it the way we think we should use it, which is five and six is equal to, and then change that to eight and equal to,', 'start': 1513.949, 'duration': 8.046}, {'end': 1523.617, 'text': 'and now we get the right answer.', 'start': 1521.995, 'duration': 1.622}, {'end': 1527.779, 'text': 'Okay so there is a whole bunch of things about TK Inter.', 'start': 1523.897, 'duration': 3.882}, {'end': 1534.101, 'text': "And like I said, there's going to be a whole bunch of other videos after this one explaining pretty much everything you'd want to know about TK Inter.", 'start': 1527.959, 'duration': 6.142}, {'end': 1537.582, 'text': 'And like always, please leave your questions and comments below.', 'start': 1534.441, 'duration': 3.141}, {'end': 1538.963, 'text': 'Otherwise, until next time.', 'start': 1537.822, 'duration': 1.141}], 'summary': 'Demonstration of correcting input and performing calculations using tk inter interface.', 'duration': 54.252, 'max_score': 1484.711, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU1484711.jpg'}], 'start': 1275.006, 'title': 'Creating sum calculator', 'summary': 'Explains creating a sum calculator using tk inter, obtaining user input, performing calculations, displaying the result, correcting input errors, and hints at more in-depth tutorials on tk inter.', 'chapters': [{'end': 1316.368, 'start': 1275.006, 'title': 'Creating entries and positioning elements', 'summary': 'Explains how to create and access entries while positioning elements using a simple layout.', 'duration': 41.362, 'highlights': ['Explaining how to create and access entries while positioning elements using a simple layout, with an example of using pack to position elements.', 'The importance of adding positioning elements after creating entries to access the information stored inside them and later grab information out of the widget.']}, {'end': 1405.183, 'start': 1316.368, 'title': 'Creating summing interface', 'summary': 'Demonstrates creating an interface to sum two input values and update the interface, including adding a label and an equals button with an event handler to execute the sum function.', 'duration': 88.815, 'highlights': ['The chapter demonstrates creating an interface to sum two input values and update the interface, including adding a label and an equals button with an event handler to execute the sum function.', 'The interface allows users to input two values and then sums them, updating the interface with the result.', 'An equal button is created with an event handler to execute the sum function when clicked by binding the left mouse button.']}, {'end': 1538.963, 'start': 1405.463, 'title': 'Tk inter basics: sum calculator', 'summary': 'Explains the process of creating a sum calculator using tk inter, including obtaining user input, performing calculations, and displaying the result, with an emphasis on correcting input errors. it also hints at more in-depth tutorials on tk inter to follow.', 'duration': 133.5, 'highlights': ['The chapter covers creating a sum calculator using TK Inter, emphasizing obtaining user input, performing calculations, and displaying results.', 'The process involves obtaining user input, converting it into integers, performing addition, and displaying the result.', 'The tutorial addresses handling input errors, such as correcting the displayed result when incorrect input is provided.', 'The author hints at more comprehensive tutorials on TK Inter in the future, encouraging audience engagement for further questions and comments.']}], 'duration': 263.957, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tbWoZSi3LU/pics/-tbWoZSi3LU1275006.jpg', 'highlights': ['The chapter covers creating a sum calculator using TK Inter, emphasizing obtaining user input, performing calculations, and displaying results.', 'The process involves obtaining user input, converting it into integers, performing addition, and displaying the result.', 'The tutorial addresses handling input errors, such as correcting the displayed result when incorrect input is provided.', 'The chapter demonstrates creating an interface to sum two input values and update the interface, including adding a label and an equals button with an event handler to execute the sum function.', 'The interface allows users to input two values and then sums them, updating the interface with the result.', 'An equal button is created with an event handler to execute the sum function when clicked by binding the left mouse button.', 'Explaining how to create and access entries while positioning elements using a simple layout, with an example of using pack to position elements.', 'The importance of adding positioning elements after creating entries to access the information stored inside them and later grab information out of the widget.', 'The author hints at more comprehensive tutorials on TK Inter in the future, encouraging audience engagement for further questions and comments.']}], 'highlights': ['TKinter is included for all versions of Python 3.1 and above, for both Macs and Windows, as well as on Linux.', 'The chapter covers creating a sum calculator using TK Inter, emphasizing obtaining user input, performing calculations, and displaying results.', 'The grid geometry manager is explained, demonstrating the positioning of widgets in rows and columns like a table or a matrix, with an example of how to position a label using the grid manager.', 'Demonstrates creating a layout with label, entry, and button widgets using the grid method to position them on the screen.', 'The chapter introduces the basics of Tkinter GUI, including the use of components such as frames, labels, and buttons and how to manipulate their attributes and text content, demonstrated through a simple example.']}