Adding a tutorial option - Tkinter tutorial Python 3.4 part 19

sentdex · Beginner ·🛠️ AI Tools & Apps ·11y ago

Key Takeaways

The video demonstrates how to add a tutorial option to a Tkinter GUI application in Python 3.4, covering topics such as creating menu items, defining tutorial pages, and implementing button functionality. The tutorial utilizes Tkinter tools such as Label, Button, and WM, and applies concepts like tutorial design, navigation bar, and application walkthrough.

Full Transcript

hello everybody and welcome to the 19th part of our Python tter Programming tutorial video where we're actually building a full sized application so where we left off is we were basically adding all the menu items kind of creating the backend structure to how those will work um some of them are actually doing what their actual job is some of them still need some uh building up to actually realize what has been done um but yeah so so now we're going to add the last thing which is uh the tutorial option we're just going to kind of show um when you go to help tutorial we're not going to actually write the tutorial because the program isn't complete yet so there's not much point to write a full tutorial when um that might not be the best tutorial for the end result um but anyway we're going to actually we're just going to show like how like we might do a tutorial so let's go ahead and get started so we're going to actually we've already defined tutorial uh let me just cut that and we'll put that up here so tutorial no longer will pass um we've got a couple of things um we are going to go ahead and Define page two as um actually I think on this I'm trying to think here uh maybe I just okay because we're going to start T so I didn't really quite think this through because this one in my in my actual code I use that leave mini um we we'll change that maybe at the very end so for now we'll say leave mini what and then what do destroy okay so then Define page two will be uh um leave mini so in theory I think what I could do is just like t. destroy and then we could do Tut two right equals tk. Capital TK and in fact let me just comment this out we might not need that after all so the you know the loadup tutorial it'll load a window and then they'll progress into page two which will redefine itself um tk. TK um um and then we'll do Define page three like this and then again we'll do tutou two. destroy and basically you would continue doing this all the way to as deep as you wanted it to go but for now we'll just go to three pages um and this will basically force a specific succession you might not want a specific succession you might actually want your tutorial to have like a navigation bar to it and people can pick various options I've I've always been a huge fan of like clicking on a tutorial and having them walk me through the application one step at a time and that be it I've always found those to be the most beneficial to me you might change your mind and if you do feel free to write your own little tutorial that you think is superior and if it's good enough share the code with me and we'll let the user decide if they want to walk through or more of a navigation you know you can always have two tutorials um so page three Tut two. destroy um and then we Define tutorial 3 so Tut three for example uh would equal tk. TK and basically what happens is around um so so like we haven't actually defined the tutorial page yet uh and we will it will be like down point to the screen you can't see the screen it'll be down here and then page two's definition we'll have page three and whenever we're ready for page three and because like basically what we'll have is we'll have page page to code here and then the button that you click next the command for next will be page three which destroys page two loads up page three with whatever data is in page three that's how it works so what we'll do is we'll put some code here now um so Tut 3al tk. TK Tut 3. wmor title uh we'll call this part three and uh we'll say label equals ttk do Capital label uh Tut 3 um text Will equal part three and then the font that we use uh we're going to use just the normore font like that good enough and then we're going to do label. pack as usual with our labels we do side top uh Phil X and Patty 10 well not 190 10 uh then we're going to have B1 equals ttk do button with a capital b um that button goes to toot three text is since this is the last one we're going to say the text is done and then the command itself will just be Tut 3. destroy easy enough then we're going to do B whoops b1. pack and then Tut 3. main Loop okay so that's page three but now we have to Define page two right so this is what will run when the user clicks the same kind of structured Button as here and it'll run T instead of running T 3. destroy it runs page three which just so happens to be the first thing that page three does is destroy page two uh and then it runs page three so now um now that we've defined page three we need to Define page two and page two will basically be exactly the same as page three so I'm going to go ahead and just copy this and then put it here paste and highlight this section hold control Open brackets that should shift it over if that doesn't work for you sorry uh and now instead of Tut three this is Tut two it's not part three it's part two it's not Tut three it's two it's part two uh not done next and then not Tut three. destroy it's actually Tut actually no it's not even any destroy it would be the command is Page Three page three packs and then not t to main Loop T I mean not t three main Loop t two main Loop okay and now we Define um the main tutorial um and so so for example um we'll just we'll write this one ourselves so let's say Tut and then that equals tk. TK and then Tut wmor title title equals tutorial and then we're going to have label equals TDK do label and as that's going to be to tou the text will be what do you need help with and the font will be normore all caps font okay now label. pack as usual our packs are always the same so let's go ahead and just copy this right here I'm not going to write that again uh paste good um and now uh is where we're going to put in some buttons so and this is what I was talking about before you don't actually have to have a walkth through necessarily like the user might just have a simple question so like for example um we could have a B1 equals uh TDK do button that button goes to Tut and the text of that button equals uh overview of the application so this is the one that's going to walk them through step by step in a very linear progression methodology that is what we basically coded up in this window here that I'm pointing to that you can't see overview the application and then command if they do that would be page two okay and that's this function which immediately destroys the tutorial starts up a new when window loads up page three just in case we call it and then runs page two and you know in theory gives a tutorial so or the second part of our tutorial um so that's for button one then we'll just say b1. pack easy enough um so we don't have to type everything all again let's just copy that uh oh actually that need to be empty parameters there so copy this and then paste twice paste paste now we're going to talk about B2 B2 and this will be B3 B3 so for B2 what do we want button two to do well button two maybe the user uh wants just to know how to trade so how do I trade with this client okay the command here uh we're going to say uh for now is just Lambda colon popup message not yet completed um and then this other one will be the same thing with a command and not yet completed so copy that paste so they're both you know commands not yet completed and then so someone might ask um how do I trade with this client and then someone else might ask a popular question that people want to know is um uh is with indicator questions help you know how to indicators work that sort of thing another one is how do I get an API uh you know how do I acquire API information CU to trade on the various exchanges you have to connect to the API on that exchange um so people might ask that question and then finally when everything's all said and done however we're going to do t. main Loop empty parms and that's that that is our tutorial function so now way you could save and run that hopefully without error but we'll see now we have help tutorial they click on a tutorial this little window comes up what do you need help with they might click uh how do I trade with this client that's not yet completed um that's not yet completed overview of the application however they click that a new window pops up part two we didn't pack the button good job okay one second let's go pack that button oh actually we got a trace back ah let's see if I can figure it out before we get there but I'm not seeing it oh here it is here's our Trace back right here figured it out guys so we packed that's the reason the button didn't even show up either the button was packed to tut three we do Tut two but we still might let's see if I can figure out if we have another Trace back somewhere I'm not seeing why we would or another error another Trace back anyway we'll have to watch for Trace back uh help tutorial overview part two next part three awesome done okay that worked no errors besides the syntax that counter nonsense awesome so um what this wording is up here by the way is just that we have this these um default Val use um there's a couple of things that we could do to like get away from this but we're just going to leave them there for now it's not like a it's not a world stopping error as you can see the application still runs it's really just more of a syntactical uh problem Guido would be very unhappy with me um so anyways I the tutorial is done now I mean it's not at Le the backend so this would be simple questions that people might have this would be like a walkthrough tutorial so they click on that now they're learning about one part there it says you know click on top indicator add RSI click 14 awesome you've added a top indicator okay so that's part two then they hit next because they're done now you can add bottom indicators click on bottom indicator back and so on okay so you can do that all the way through really walk the client through how the um walk the client how the client Works anyway um so that's that um so now we've got all of the menu options that I initially want us to cover and now we need to start building those menu options so a lot of them are fairly easy but or well some of them are fairly easy the rest of most of these are going to require some pretty fancy code and at this point this is where this program is going to heavily Veer off into weighing more so into the actual purpose of this client so up to this point we've really built a backbone that really could be supported by a huge array of clients um but now we're actually going to to be um really building this client up for this very specific purpose of working with um Bitcoin trading and all of that um the main thing that I would say is still pertinent to anybody else is what we'll end up doing with trading especially manual trading what manual trading is going to do is it's going to open up another window so it'll be another window but it's still part of the application itself so you'll have two windows um mostly because people may want to put you know their trading window over here the main graph window over here you should let them kind of Orient where everything is um so and that was actually something that people kind of voted on on Reddit so that's the way we're going to do it so anyways um so that's that that's what you guys have to look forward to we're going to start working on uh getting this graph to connect or this client to connect to C of BTC for the daily data uh then working on the open isow close actually adding the indicators that kind of stuff and then after that um trading that kind of stuff also pause resume doesn't actually work at the moment um anyway that kind of stuff so we're really going to actually start pulling this application together and uh making something interesting out of it now so anyways we got a nice back end hopefully you guys are enjoying um I was I've really enjoyed doing this really this series and actually working on this application I didn't really know if if you could do something like this in Python successfully so um I'm pretty confident we can the major hurdle I think now in the future is is actually threading this application but I know with 100% certainty it's possible I just have not done it so that'll be a hurdle anyway um if you guys have any questions or comments please feel free to leave them below otherwise you know the deal as always thanks for watching thanks for all the support and subscriptions and actually thank you for donations as well I have received I've started receiving donations someone actually mailed me a check uh the other day for this specific Series so um thank you so much uh for those so so anyways um uh stay tuned to the next video as always thanks for watching thanks for all the support subscriptions till next time

Original Description

Tkinter GUI Tutorial Playlist: http://www.youtube.com/playlist?list=PLQVvvaa0QuDclKx-QpC9wntnURXVJqLyk In this tkinter how-to tutorial, we cover how to add a tutorial option to our program. http://seaofbtc.com http://sentdex.com http://hkinsley.com https://twitter.com/sentdex Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from sentdex · sentdex · 0 of 60

← Previous Next →
1 Matplotlib Python Tutorial Part 1: Basics and your first Graph!
Matplotlib Python Tutorial Part 1: Basics and your first Graph!
sentdex
2 Python Encryption Tutorial with PyCrypto
Python Encryption Tutorial with PyCrypto
sentdex
3 Python's Logging Function
Python's Logging Function
sentdex
4 wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
sentdex
5 wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
sentdex
6 wxPython Programming Tutorial 3: Menu Bar and Menu Button
wxPython Programming Tutorial 3: Menu Bar and Menu Button
sentdex
7 wxPython Programming Tutorial 4: Panels
wxPython Programming Tutorial 4: Panels
sentdex
8 wxPython Programming Tutorial 5: User Input Saved To Variables
wxPython Programming Tutorial 5: User Input Saved To Variables
sentdex
9 wxPython Programming Tutorial 6: Multiple Choice Input
wxPython Programming Tutorial 6: Multiple Choice Input
sentdex
10 wxPython Programming Tutorial 7: Adding Static Text and Colors
wxPython Programming Tutorial 7: Adding Static Text and Colors
sentdex
11 wxPython Programming Tutorial 8: Custom Button Images
wxPython Programming Tutorial 8: Custom Button Images
sentdex
12 wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
sentdex
13 Basic PHP Tutorial 13: Multi-dimensional Array
Basic PHP Tutorial 13: Multi-dimensional Array
sentdex
14 Basic PHP Tutorial 15: Functions and Global Variables
Basic PHP Tutorial 15: Functions and Global Variables
sentdex
15 Basic PHP Tutorial 12: Associative Array
Basic PHP Tutorial 12: Associative Array
sentdex
16 Basic PHP Tutorial 14: Foreach loop
Basic PHP Tutorial 14: Foreach loop
sentdex
17 Basic PHP Tutorial 16: Include and Require
Basic PHP Tutorial 16: Include and Require
sentdex
18 Basic PHP Tutorial 7: Assignment, comparison and Logical operators
Basic PHP Tutorial 7: Assignment, comparison and Logical operators
sentdex
19 Basic PHP Tutorial 4: Variables and Comments
Basic PHP Tutorial 4: Variables and Comments
sentdex
20 Basic PHP Tutorial 11: Arrays part 1, basic array
Basic PHP Tutorial 11: Arrays part 1, basic array
sentdex
21 Basic PHP Tutorial 6: If else and else if conditionals cont'd
Basic PHP Tutorial 6: If else and else if conditionals cont'd
sentdex
22 Basic PHP Tutorial 1: Intro to PHP
Basic PHP Tutorial 1: Intro to PHP
sentdex
23 Basic PHP Tutorial 3: HTML with PHP
Basic PHP Tutorial 3: HTML with PHP
sentdex
24 Basic PHP Tutorial 9: While Loop
Basic PHP Tutorial 9: While Loop
sentdex
25 Basic PHP Tutorial 10: Switch Statement
Basic PHP Tutorial 10: Switch Statement
sentdex
26 Basic PHP Tutorial 2: Print and Echo
Basic PHP Tutorial 2: Print and Echo
sentdex
27 Basic PHP Tutorial 5: If else and else if conditional statements
Basic PHP Tutorial 5: If else and else if conditional statements
sentdex
28 Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
sentdex
29 Basic PHP Tutorial 17: User Input Form Example / String Manipulation
Basic PHP Tutorial 17: User Input Form Example / String Manipulation
sentdex
30 Basic PHP Tutorial 18: HTML Entities and forms cont'd
Basic PHP Tutorial 18: HTML Entities and forms cont'd
sentdex
31 Basic PHP Tutorial 19: Finding words in strings
Basic PHP Tutorial 19: Finding words in strings
sentdex
32 Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
sentdex
33 Basic PHP Programming Tutorial 22: Hashing part 2: salting
Basic PHP Programming Tutorial 22: Hashing part 2: salting
sentdex
34 Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
sentdex
35 Basic PHP Programming Tutorial 21: MD5 Hashing For Security
Basic PHP Programming Tutorial 21: MD5 Hashing For Security
sentdex
36 Basic PHP Programming Tutorial 24: String similarity
Basic PHP Programming Tutorial 24: String similarity
sentdex
37 Basic PHP Programming Tutorial 25: Time and Time stamps
Basic PHP Programming Tutorial 25: Time and Time stamps
sentdex
38 Basic PHP Programming Tutorial 26: Die and Exit
Basic PHP Programming Tutorial 26: Die and Exit
sentdex
39 Basic PHP Programming Tutorial 27: MySQL Databases Part 1
Basic PHP Programming Tutorial 27: MySQL Databases Part 1
sentdex
40 Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
sentdex
41 Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
sentdex
42 Basic PHP Programming Tutorial 30: MySQL database in Use
Basic PHP Programming Tutorial 30: MySQL database in Use
sentdex
43 Django Tutorial Web Development with Python Part 1: Installing Django
Django Tutorial Web Development with Python Part 1: Installing Django
sentdex
44 Python Tutorial: File Deletion and Folder Deletion / directory deletion
Python Tutorial: File Deletion and Folder Deletion / directory deletion
sentdex
45 Python Tutorial: How to Rename Files and Move Files with Python
Python Tutorial: How to Rename Files and Move Files with Python
sentdex
46 3D Graphs in Matplotlib for Python: Basic 3D Line
3D Graphs in Matplotlib for Python: Basic 3D Line
sentdex
47 3D Plotting in Matplotlib for Python: 3D Scatter Plot
3D Plotting in Matplotlib for Python: 3D Scatter Plot
sentdex
48 3D Charts in Matplotlib for Python: Multiple datasets scatter plot
3D Charts in Matplotlib for Python: Multiple datasets scatter plot
sentdex
49 Sikuli Tutorial 1: Visually programming in python!
Sikuli Tutorial 1: Visually programming in python!
sentdex
50 Sikuli Tutorial 2: Program visually in python!
Sikuli Tutorial 2: Program visually in python!
sentdex
51 Sikuli Tutorial 3: Program visually in python!
Sikuli Tutorial 3: Program visually in python!
sentdex
52 3D Bar Charts in Python and Matplotlib
3D Bar Charts in Python and Matplotlib
sentdex
53 3D Plane wire frame Graph Chart in Python
3D Plane wire frame Graph Chart in Python
sentdex
54 Raspberry Pi Part 1 Introduction
Raspberry Pi Part 1 Introduction
sentdex
55 Raspberry Pi Part 8: First Download and Update! (Firmware)
Raspberry Pi Part 8: First Download and Update! (Firmware)
sentdex
56 Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
sentdex
57 Raspberry Pi Part 11: Remote Desktop
Raspberry Pi Part 11: Remote Desktop
sentdex
58 Twitter Analysis: How to rank a user's influence
Twitter Analysis: How to rank a user's influence
sentdex
59 GPIO Tutorial for Pi Part 2 - Programming the GPIO
GPIO Tutorial for Pi Part 2 - Programming the GPIO
sentdex
60 GPIO Tutorial for Raspberry Pi Part 1 - Setting up
GPIO Tutorial for Raspberry Pi Part 1 - Setting up
sentdex

This video tutorial covers the process of adding a tutorial option to a Tkinter GUI application in Python 3.4, including creating menu items, defining tutorial pages, and implementing button functionality. The tutorial provides a comprehensive overview of GUI development concepts and Tkinter tools. By following this tutorial, viewers can develop their own interactive tutorials and GUI applications.

Key Takeaways
  1. Define page two as leave mini
  2. Destroy and then redefine page two
  3. Define page three and destroy page two
  4. Load up page three with data
  5. Define page three with button to destroy page two and run page three
  6. Define page two with button to run page three
  7. Create main tutorial window with label and buttons for navigation
  8. Pack the button
  9. Run the tutorial
  10. Click on the help menu
💡 The tutorial highlights the importance of creating interactive and user-friendly GUI applications, and demonstrates how to utilize Tkinter tools to achieve this goal.

Related AI Lessons

Up next
I Asked ChatGPT to Apply to 500 Jobs (8 Interviews in 48 Hours)
Sabrina Ramonov 🍄
Watch →