Organizing our GUI window - Tkinter tutorial Python 3.4 p. 8

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

Key Takeaways

This video tutorial covers organizing a GUI window using Tkinter in Python 3.4, incorporating live pricing data, and using pandas and numpy for data manipulation. It demonstrates how to create a GUI window, use public APIs, and orient code for future changes.

Full Transcript

what's going on everybody welcome to another teiner tutorial video uh in this video what we're going to be doing is talking about how we can start incorporating live pricing data into our application so there are tons of ways that we could do this we could do this with pure python code grab what is a Json but just treat it like a text split it up and all this um but managing the data sets is uh it's going to be a little bit bigger of a deal especially once we start uh applying some information to it so in let's say the the tick data for example that we're going to pull that's going to be live data it's going to show every single buy and sell uh and so to do that properly we want to be able to for one differentiate between buy and sell but then as time goes on we're going to want it might be a lot of data that we're pulling so we might me we might say pull uh three days worth of data but then we want to have like say the Open high low Clos candlesticks be uh 30 minute data instead of the say Five Minute data that we pull stuff like that um so we're going to down the road want to really um modify the data set a lot or a little but we want to have the ability to so the easiest way to do that is with a combination of of quite a few things so the first thing I'd like us to go ahead and do is we'll come over to uh let's just go to we'll just go to google.com for now um and I'll bring this down and let's see the first thing uh that I'd like us to go ahead and do is actually in fact here's what we'll do we come over here first and we're going to import URL lib import Json and these two things are built into python you already have them and then also we're going to import pandas as PD and then import numpy as NP uh numpy is for number crunching for the most part uh and then pandas is for data uh manipulation both of these things are not automatically included in Python uh you can find out if you have it by opening up a quick gooey here um and then just try to do import pandas and then wait a second import numpy something like that and if you can do that then you already have the modules and you're good to go if you don't already have the modules uh then you are going to want to get them and let me pull up all of the uh these two things hand does and then finally I've got one more uh location for this let's see so if you're on uh let's say Mac or um Linux you can't use this website but if you're on Windows this is the website I would suggest you use to get um get these things so let's say you want numpy you just do crlf search for numpy click on it and here's numpy these are all of the things so like for me I'm on a 64-bit 3.4 so this would be my oops not that one this would be my download if you're on uh 32bit 3.4 this would be your download um and in fact hold on what's the differ oh actually I'm sorry this wouldn't be your download uh this one this is the most recent version um so you have those um otherwise and then same thing with pandas okay so we could type in pandas and here's pandas right here download pandas so we can use pandas if you are on like say Mac OS or maybe on a Linux system first of all if you're on Linux you just do app get or something or pip install but otherwise numpy is on num. org and then we have pandas which is pandas doi.org and then you would go to get pandas and all that so depending on on on uh you know what operating system you're on the actual downloading and installation process might vary um so again for Windows I would just suggest you use this website if you're not on Windows um use you know these websites or pip install or whatever you happen to use to install module so uh once we have those things let's move that over here um you've got pandas and numpy you are ready uh to uh get into this stuff so first of all let's save and run this and talk a little second about what we really want so when we start up this application what we want to do is the starting page is going to be a little bit of a warning page so we've got a start page and then eventually we'll have a sort of homepage but for now uh we're going to be doing most our work with the BTC exchange so we're going to build all of the back end using that exchange as an example and then we'll just kind of Port everything over to the other exchanges uh when we need to and at that point we might have a homepage or a start page that uh lets you pick between exchanges uh but as long as we're always going to be launching into the BTC exchange we're not going to have a homepage just yet doesn't really make much sense because every time we would test it we have to click all these buttons and so that's kind of annoying so we're just going to leave that for now but we're still going to have this warning p page pop up and then we'll just have them click agree and then uh they'll be launched into BTC whereas normally they would launch into the homepage so the start page will just have a warning like hey this is a beta uh program use at your own um discretion or risk or whatever so that's what we want to do and so we're going to do uh make some changes basically so first of all uh we'll come up you know this is our app but we want to go to start page basically this page right here and and uh these things here see we only need two buttons so I'm going to delete button three and then we're actually going to call this button one and button one pack there and um and instead of visit page one visit page two we're going to call this one agree and this one will be disagree if they disagree we don't need Lambda we don't need anything really besides we'll just put quit so if they hit disagree it leaves the application um otherwise if they hit agree we want to show frame and normally we would show frame we don't have one yet but we would if we had a homepage we would say okay we want to show page homepage uh but for now we're going to have it send it to BTC page that doesn't exist yet but we're right about to make it so that's what we want the start page now the only other major thing I'd like us to do is we've got you know self text large font start page instead of saying start page we would want to say uh um um let's let's call this we're going to call it Alpha Bitcoin actually let's capitalize Bitcoin Bitcoin trading application um and also if you want to do like multi-line text this is how you can do it you can do um see like if I do this comment down here uh and do blah blah blah right it's not connected right so the way that you can get around that is one you could use new line or something like that um but the superior method would be three quotes as if you were almost commenting it out but you're not um Alpha Bitcoin trading application um and then we'll just kind of tab it whoops oh no what happened there I thought I'd get away with tapping it over but I guess I I can't tab it that far um let me try let me try one more thing uh before I thought we would get away with this Alpha Bitcoin tra what seriously okay um can't quite figure out why that's not being kind to me but anyway Alpha Bitcoin trading uh application uh use at your own risk um there is no promise promise oh nice now it's it's going of warranty um and that's good enough for now once this goes a little uh longer uh we'll we'll put in a proper uh warning there so so now we have that and now what we want to go ahead and do is uh we've got the label let's go ahead and see what this looks like oh well this isn't going to work yet so um we've got page one page two uh we I wouldn't mind leaving one of these just to just for reference later on but we'll delete page two and instead of Page Three we're going to call this BTC page like that um and that's our graph page so that stays the same uh so let's go ahead oh wait we need to go up here um so anytime you add pages what you always have to come into the the main class here and we come down and see we've got start page page one two and three uh we still have page one I'm just going to leave that for reference we're not actually going to use that page so we've got start page and then we have uh BTC eore page like that and those are our pages so now um the other thing that I want to do oh so if they agree they go to BTC page page back to Hom to go to start page and we no longer need a page two so we'll delete that now let's go ahead and save and run that see if we' messed up anything uh so our indentation is not the best um yeah and it's CU I added all these tabs I'm pretty sure use at your own there's no problem man I had this working on on uh my other my my actual version anyway let's click that real quick okay so back to home back to this page um I guess we we could use the new lines this isn't very long I just don't I'm not quite confident as to why um here's what here's what I'll try to do at least on my version I do something more like this so let's try this version save and run that um yeah that looks a little better so so that's good enough for now and we hit agree and we go to the graph so good enough so back to home good that's aligned well enough so exit out of this and now what we want to talk about is actually getting this data um into our uh our chart so we want to have the connection to the actual BTC server so if you go to BT s BTC Das uh actually I had one of my usernames in there get rid of that um moving on uh btc.com um and come down to the bottom [Music] here uh let's just do that and go all the way down you get trade API and there's also public API um really what we're going to be using is the public API for now and then we'll get into trade API but for now you just would use public API to actually acquire the pricing data so these are where you would get you know pricing basically like this stuff or this I'll show you exactly what we're going to be doing but here's an also here's like a ticker so you can click on that and this would be the current prices but we're actually going to go for is the trade history wow my information still stays in there thank you Google um anyway this account has like no money on it so there that's actually this will be the account that we use uh for this tutorial so anyways um so this is uh basically the the the API and all that and so I think what we'll do is I'll cut off this video here and then we'll talk about in the next video how uh we can connect to the API pull that data and because it's live data right so we can keep querying their API so they also have a a socket API as well well not really going to get into that uh yet it would it would be really cool to incorporate that eventually into this this um this client just because the socket API is really cool um but for now we're just going to use the typical you know static API where we just keep making requests so uh so that's what you guys have to look forward to uh in the next video so if you guys have any questions or comments up to this point really we're just kind of orienting the code uh to support uh the changes that are coming but if you do have any questions or comments at this point please feel free to leave them below otherwise as always thanks for watching thanks for all the support and subscriptions and until next time

Original Description

In this Python 3 with Tkinter programming tutorial, we cover how to organize the tkinter window. Tkinter GUI TutorialPlaylist: http://www.youtube.com/playlist?list=PLQVvvaa0QuDclKx-QpC9wntnURXVJqLyk 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 teaches how to organize a GUI window using Tkinter in Python 3.4 and incorporate live pricing data. It covers the basics of GUI window organization, API integration, and data manipulation. By following this tutorial, viewers can learn how to create a GUI window, use public APIs, and orient code for future changes.

Key Takeaways
  1. Import URL lib, Json, pandas, and numpy in Python
  2. Get pandas and numpy from the official websites or using pip install
  3. Delete button three and rename button one to 'agree' and button two to 'disagree'
  4. Use 'quit' for 'disagree' button and show frame for 'agree' button
  5. Create BTC page and delete page two
  6. Rename page three to BTC page and use public API to acquire pricing data
💡 Using Tkinter and public APIs can simplify the process of creating a GUI window and incorporating live pricing data into an application.

Related AI Lessons

Up next
How to Open HPL Files (HP-GL Plotter)
File Extension Geeks
Watch →