
Here we will see:
The final result;
What do we need to get started.
Here we will learn how to:
Create a window with TKinter;
Set the window title;
Set the minimum and maximum size of a window;
Create Frames and separate the structure in three areas - top, middle and bottom;
Set frame width, height and background color;
Place, the exact position of a frame in a window;
Make a frame grow or shrink, accordingly with the window current size;
Structure the code.
Here we will learn how to:
Create a Label;
Set the Label text;
Insert and position the Label inside of a Frame;
Make Label grow or shrink accordingly with the current size of the Frame;
Position the text inside of Label - right, center or left;
Set font and font size of text in a Label;
Make the Label text bold.
Here we will learn how to:
Create a Button;
Set the Button text;
Set font and font size of Button text;
Add an action to a Button;
Insert and position the Button inside of a Frame;
Make the Button grow and shrink accordingly with current Frame size.
Here we will learn how to:
Optimize Button creation with for loop;
Pass parameters to a Buttons action - with a lambda function;
Pass parameters to a Buttons action - without a lambda function.
Also we will understand how:
lambda function works;
Buttons parameter command works.
Here we will learn how to:
Distinguish if a char is a digit or not;
Change the text of a Label;
Detect if a string starts with a specific char;
Apply logic to solve a problem.
Here we will learn about Operators Precedence rules.
Here we will learn how to define the base structure to create a binary tree, the classes: Node and ExpressionTree.
Here we will learn how to add elements to the binary tree. Also, we will see how it will be connected with our calculator!
This is where everything will makes sense! We will learn how to take advantage of binary tree to calculate an expression and why it works!
Here we will solve one small problem, division by zero! We will learn how to apply extra logic to improve our calculator.
Here we will install and use Auto Py to Exe to generate a stand alone executable file for our application.
https://pypi.org/project/auto-py-to-exe/
Here we will learn how to create a Tk Object (the window) and launch it.
We will see how to set a title, set the window size, set the window position on the screen and set the window not resizable!
Here we will learn how to create Frames, set its width/height and change its background color.
Also we will see how to organize the code in logical parts and learn a little bit about TkInter Layout Managers: grid, pack and place!
Here we will learn how to create Buttons! We will set its text, what it should do when clicked and how to disable a button.
About the pack, we will learn how to place elements side by side.
Here we will acknowledge 3 widgets: Label, Entry and Spinbox. We will see how to set the text, justify it (text alignment) and add a border to the widgets. About the Spinbox we also will learn how to set the width, set min value (from_), set max value (to), default value (textvariable with a IntVar object), set it as readonly (Spinbox state) and how increment value will work.
Here we will learn how to get the value of a Entry and a Spinbox! About the pack method we will use the parameter padx!
Here we will refactor the code in order to define a specific area for global variables!
Here we will learn how to use Fonts, change the font family, size and weight (to be bold). We will apply them on Labels, Buttons and Entries!
Here we will learn how to list available fonts. Also we will Download/Install and use TTF Fonts (True Type Fonts). Finally I will show how to Uninstall a TTF Font on Windows 10!
Here we will learn a useful tip about Visual Studio Code, also we will learn how to get the width and height of a Frame!
Here we will review how to create Buttons, Labels and how to pack side-by-side.
Here we will review how to get the width and height from a Frame. We will learn how to create frames dynamically and how to set borders to frames! Also I'll give you some tips about Visual Studio Code!
Here we will review how to create dynamically Frames, how to get the width/height from a Frame, how to add borders and pack Frames side-by-side!
(!) At the end I have an important final note!!!
Here we will see how can we express the idea of a product (Product Class) and how can we manage the data (DataManager Class).
Here we will structure the code to split the task of loading product properties into a row.
Here we will review how to create Frames, get its width and height, how to create Labels and set its font.
Here we will learn something about Frames that we didn't expect!!
We will see how to use frame.propagate(False) and also pack(expand= True).
Here we will learn how to create a check button and how it works! We will see the classes Checkbutton and BooleanVar.
Here we will learn how to load an Image into a Label!!!
Pillow is required for this lecture! With Pillow we will open an image file, resize it and convert it into something that TkInter understands.
Here we will see how to enable/disable a Button and also how to change the text of a Label!
Here we will calculate the total Page Number with the help of math.ceil!
Here we will refactor some code and we will learn how to remove elements from a Frame!
Here we will start to implement the mechanism for searching!
Here we will implement filtering the data for the search action!
Here we will clear the search inputs the Entry and the Spinbox!
Here we will see how to keep a list with the products to be deleted. Also we will change the state of a Button to be ACTIVE or DISABLED!
Here we will solve the bug about the list of products to be excluded.
Here we will finally delete the products! Also we will see how to make a popup window (messagebox) to ask the user if he wants to delete or not!
Here we will learn how to bind an action to mouse right click event!
Here we will learn how to create a new window! It is called Toplevel!! Also we will create a new class that will represent the Product Editor!
Here we will separate the Product Editor window in three Frames. We will review some of the concepts we've learn before.
Here we will review how to create elements of the classes Frame, Label, Button, Spinbox and IntVar.
Also it will become more clear for us how properties like propagate (Frames) and expand (pack) works!
Here we will learn about a new element, a new widget!!! It is called LabelFrame!!!
Here we will discover a new input for text!!! It's not the Entry! It's the Text widget!
Also we will learn how to insert a string into an Entry and Text widgets! Finally we will see new parameters that we can provide to the pack method (fill and ipady)!
Here we will review how to get the width and height of a Frame. Also we will see Frames, Labels, Buttons, how to load an image into a Label, frame propagate and pack expand. We will face an unexpected problem too...
Here we will learn how to open a file selector window!!! It is called a filedialog! We will see how to set its title and how to select only images!
Here we will review how to set an image to a Label!
Here we will learn how to close a window! How to get values from Entry, Text, Spinbox widgets! And finally we will see a work around to get the image path from a label!
Here we will create two functions at DataManager, one to update a product and another to insert a new product into the database!
Here we will see how to provide to ProductEditor a method from MyStockManager class and finally we will put all the missing pieces together!
Here we will use auto-py-to-exe to generate an executable for our app!
We will also learn how to create a virtual environment for Python.
Here we will see a preview of the final PDF documents that we will generate.
Here we will create a new Frame in Product's Editor Window, after that we will insert a Button to generate a PDF with Product's info.
Here we will learn how to install ReportLab and how to use it to Generate a PDF.
Here we will learn how to Draw a Centered String into the PDF using ReportLab. Also we will see how to change the font and font size!
Here we will learn how to Draw an Image in the PDF using ReportLab. Also we will learn how to resize the image and how to keep it's aspect ratio!
About the text, we will see how to change it's color!
(!) Note: To draw an Image in some cases it's required to install/update Pillow!
Here we will add the description of a Product. Also we will learn that every time we set a font or a color, ReportLab will keep it as a global configuration!
Here we will add a new button to the main window!
Here we will define the main actions of exporting a PDF with all Products!
We will add a function in DataManager so we can get all the Products at once and we will define a function to generate an empty PDF file!
Here we will see how to reuse code from Single Product PDF and we will learn how to create multiple pages with ReportLab.
Here we will use auto-py-to-exe to generate an executable for our app!
Here we will see how our application will load the description using images.
Here we will learn how to add Menus to our app. We will create cascaded menus, add commands and separators!
Here we will add actions (command parameter) to some menu options!
Here we will review how a lambda function actually works in Python.
Here we will learn about easyOCR (easy Optical Character Recognition), a third party module that will help us extract text from images!
Here we will understand why our app started to freeze when loading text from images!
We will review concepts like Processes, Threads, Main Thread, Event Notifier and Event Queue.
Here we will find a simple solution but perhaps not the best one! We will learn how to create a new Thread and delegate the image analysis work to it!
Here we will learn that the previous solution has a critical flaw!
We will implement a better solution!
Here we will see the final version of the Docx documents that we will generate.
Here we will install a third party module called python-docx, we will use it to generate docx files.
Here we will guide ourselves through python-docx documentation so we can add the Title, Image and Description of a product to our generated Docx file!
Here we will learn how to center the Title in the document. To achieve our goal we will use Python functions "type" and "dir" to inspect the variables. Also we will take advantage of powershell to search for a string in multiple files.
Here we will again inspect the elements from python-docx to learn how to increase the font size. We will also learn that font size is specified in the unit Points!
Here we will investigate how we can center the Image in the Docx with python-docx.
Here we will Justify, increase the Font Size and change the Font Name of Description!
Here we will review how to create Menus in TkInter, how to add cascades and commands to them!
Here we are going to adapt the Docx generation code to stay in a function, so we can call it in the TkInter application when we select the option to generate Docx File!
Here we will have an overview about the new docx with all the products.
Here we will create a Button for the action Export Docx!
Here we will create a class that extends Toplevel class in order to create a new window where we will add options for our docx file!
Here we will review how to create frames and we will take advantage of that to separate the window into two logical areas.
Here we will add two more frames to the window top frame so we can separate the Title Size options from Title Color options.
Here we will build the Frame Options Title Size, we will use and learn how Radiobuttons work!
Also we will use the "anchor" parameter in pack method!
Here we will build the content of Frame Options Title Color, we will add a label and use and learn how a Combobox works!
Here we will add a button to the Frame Button so later we could call the action that will generate the docx document.
Here we will refactor the docxGeneration.py to have function in the same fashion we have at pdfGeneration.py!
Here we continue to refactor docxGeneration.py, we will move code from generateProductDocx into generateProductPage.
Here we will finally generate a docx file with all the products!!!
Here we solve a small bug that happens when getting the products to show in docx document!
Welcome to Python TkInter from Beginner to Winner! A great course on building Desktop Apps!
Together we will learn, explore and have fun taking the most out of Python and TkInter! We will create great and useful apps.
I invite you not only to master TkInter but also learn how to think, how to design and structure your code, how to take advantage of several tools to do it faster, better and clean, like a professional!
First we will focus on creating apps like a calculator or a products stock manager... we will have opportunity to play with many widgets like Frames, Labels, Buttons, Spinboxes, LabelFrames, etc. Also we will use three Layout Managers to position our widgets: grid, pack and place.
Than as bonus we will integrate some of those apps with numerous technologies... We will use databases, we will interact with Web APIs, we will generate documents like PDFs and Docx!
Our imagination is the limit!
My name is Hugo Ferro, I started my programming journey back in 1996 when I got my first computer at age 12... That box changed my life! I became a Software Engineer with experience in a wide range of technologies...
Your journey starts now! I'm your teacher, I'm your partner in this great adventure that is learning!
The first 10 lectures of this course (1h41m), in section "My Products Stock Manager", are FREE for you to evaluate! What you're waiting for?
Thank you for your time, see you in the course :)