wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
Skills:
Frontend Performance60%
Key Takeaways
Installs wxPython and creates a first window
Full Transcript
What is up and welcome to yet another awesome tutorial series. This series is going to be covering WX Python. So what is WXPython? WX Python is a cross-platform toolkit used for making gueies or graphical user interfaces. Uh this is done so the end user doesn't actually have to communicate with the Python interpreter window. Right? So so nobody wants to like develop programs and have to deal with like this or like a DOSs, you know, prompt. Um it's just a plain more user-friendly way uh to make programs and have users use those programs. Um WXPython itself is actually just kind of like a wrapper around uh the language C++. Now what that means is WXPython itself is not actually coded directly in Python. uh instead it's more of like a Python interpreter kind of like you have a Python interpreter that you installed on your system because your computer didn't naturally understand Python. So the main purpose with WXPython is of course to create windows looking windows or as they're called in WX Python in programming frames. So with WX Python you can make all kinds of things like regular windows, toolbars, scroll bars, dialogues, popups, buttons etc. And then also all these things like you can use uh what are called event handlers. So like if a user clicks a button it does this or clicks the window it does this. So you can do all kinds of really cool things uh with these windows. So to get uh wxpython and start coding you're going to have to visit uh wxpython.org which I've pulled up here. And you'll want to scroll down to download. Let's see if I can find it myself. Download. And you want the stable version not the development version. So we'll click that. And here we go. So, and this is going to be the one that I want here, which is Python 2.8. I want the 32-bit version uh to match my Python. You should pick whatever uh version of Python you have, however. So, I'll just click that. We'll download the uh installer here. And here it comes. Now, we'll just I'll pause the video while we wait for this to come on. Once it's done, obviously, it's a download. So, you just click it to open that up. And you'll just go ahead and hit run there. And here we go with the installer. Next, I'll accept. This just says where it's going to install it. Next. Uh, this is just to make the uh, yeah, we'll just go next. And so now it's going to install wx Python on my machine and your machine. Do that at least. Uh, all right. and it's over here just fixing up some of the files for us. And now uh to make sure, let's test the installation. So, we'll restart our Python interpreter. Bring it over here and say import wx. And as long as it doesn't yell at us, looks like we did it right. All right. So, now we're back to the typical Python idle. Um, and so that concludes pretty much the installation, but again, uh, just like my NLTK tutorial, I feel bad making the first video being only the installation. So, let's make, uh, our first window at WXP Python. So, of course, to use WX Python, you'll need to import WX. Subsequently, now we're going to start uh, defining things uh, that we want our window to do. All right, the next thing we're going to do is define app. And every wx python must have this. Um, so that's just going to be wx.app. The next thing that we're going to do is we actually have to make the window or as I referred to it earlier, the frame. So we're just going to call it frame equals wx.frame. Uh, and then within the parameters, you have a few different things to call. Now, uh, we're just going to say the parameters within here. We're just going to say none. And then we'll put the title of this frame. Kind of like this has a title, which is basically the name of the script. And then the location of the script. You can put this anything you want. So, we're going to say uh this is the window title. We'll just put that in there. You can call it whatever the heck you want to call it, though. And basically what we were saying within these parameters here, we can go into detail of them later, but um basically the frame is a widget. And what we're saying here is this is the uh parent widget for any other widgets. So basically when we when you say none there, it just means that like it's a parent widget itself. So kind of like the uh graphing tutorials that I've got if you've been watching those. Once you actually like define something, all we've done is defined it. We haven't actually called it up. Uh so next thing you want to do is call it to show. And that's just frame show. And then finally, uh we'll just make this line here, uh appain loop. And all this does is just kind of enter us into like a main loop. So everything that happens uh during the event of like this window is going to be captured. But again, we'll go more into that later. So we'll just save this and we'll run it. And up pops our little window here. And as you can see, we've got window title and um but that's it. There's nothing in here. Eventually we're going to have, you know, menu items, maybe something in here, and we'll do some cooler stuff. But for now, this is what we have. Just a window title. But already this is pretty darn impressive. uh because there's all kinds of things to it. You've got just your, you know, even just the title. You got the little image here. You can move it around on your screen. You can resize it. You can do all these things that even though like this is such a stupid little window that doesn't actually give us any utility. Um it's actually a lot of coding behind even just this window. So, pretty cool that we've already coded this window. So, that's going to conclude this tutorial. Um stay tuned for more tutorials on WX Python. There's a lot of cool things that you can do within here and it's kind of enjoyable because there's a lot of customization that you can do along the way.
Original Description
Full Playlist Link: http://www.youtube.com/playlist?list=PLQVvvaa0QuDc4SQhfpm6XHO0l-1Ybtur2
Code for this tutorial can be found on Sentdex.com
Sentdex.com
Facebook.com/sentdex
Twitter.com/sentdex
How to make graphical windows for user-friendliness within python, using wxPython!
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from sentdex · sentdex · 4 of 60
1
2
3
▶
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Matplotlib Python Tutorial Part 1: Basics and your first Graph!
sentdex
Python Encryption Tutorial with PyCrypto
sentdex
Python's Logging Function
sentdex
wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
sentdex
wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
sentdex
wxPython Programming Tutorial 3: Menu Bar and Menu Button
sentdex
wxPython Programming Tutorial 4: Panels
sentdex
wxPython Programming Tutorial 5: User Input Saved To Variables
sentdex
wxPython Programming Tutorial 6: Multiple Choice Input
sentdex
wxPython Programming Tutorial 7: Adding Static Text and Colors
sentdex
wxPython Programming Tutorial 8: Custom Button Images
sentdex
wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
sentdex
Basic PHP Tutorial 13: Multi-dimensional Array
sentdex
Basic PHP Tutorial 15: Functions and Global Variables
sentdex
Basic PHP Tutorial 12: Associative Array
sentdex
Basic PHP Tutorial 14: Foreach loop
sentdex
Basic PHP Tutorial 16: Include and Require
sentdex
Basic PHP Tutorial 7: Assignment, comparison and Logical operators
sentdex
Basic PHP Tutorial 4: Variables and Comments
sentdex
Basic PHP Tutorial 11: Arrays part 1, basic array
sentdex
Basic PHP Tutorial 6: If else and else if conditionals cont'd
sentdex
Basic PHP Tutorial 1: Intro to PHP
sentdex
Basic PHP Tutorial 3: HTML with PHP
sentdex
Basic PHP Tutorial 9: While Loop
sentdex
Basic PHP Tutorial 10: Switch Statement
sentdex
Basic PHP Tutorial 2: Print and Echo
sentdex
Basic PHP Tutorial 5: If else and else if conditional statements
sentdex
Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
sentdex
Basic PHP Tutorial 17: User Input Form Example / String Manipulation
sentdex
Basic PHP Tutorial 18: HTML Entities and forms cont'd
sentdex
Basic PHP Tutorial 19: Finding words in strings
sentdex
Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
sentdex
Basic PHP Programming Tutorial 22: Hashing part 2: salting
sentdex
Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
sentdex
Basic PHP Programming Tutorial 21: MD5 Hashing For Security
sentdex
Basic PHP Programming Tutorial 24: String similarity
sentdex
Basic PHP Programming Tutorial 25: Time and Time stamps
sentdex
Basic PHP Programming Tutorial 26: Die and Exit
sentdex
Basic PHP Programming Tutorial 27: MySQL Databases Part 1
sentdex
Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
sentdex
Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
sentdex
Basic PHP Programming Tutorial 30: MySQL database in Use
sentdex
Django Tutorial Web Development with Python Part 1: Installing Django
sentdex
Python Tutorial: File Deletion and Folder Deletion / directory deletion
sentdex
Python Tutorial: How to Rename Files and Move Files with Python
sentdex
3D Graphs in Matplotlib for Python: Basic 3D Line
sentdex
3D Plotting in Matplotlib for Python: 3D Scatter Plot
sentdex
3D Charts in Matplotlib for Python: Multiple datasets scatter plot
sentdex
Sikuli Tutorial 1: Visually programming in python!
sentdex
Sikuli Tutorial 2: Program visually in python!
sentdex
Sikuli Tutorial 3: Program visually in python!
sentdex
3D Bar Charts in Python and Matplotlib
sentdex
3D Plane wire frame Graph Chart in Python
sentdex
Raspberry Pi Part 1 Introduction
sentdex
Raspberry Pi Part 8: First Download and Update! (Firmware)
sentdex
Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
sentdex
Raspberry Pi Part 11: Remote Desktop
sentdex
Twitter Analysis: How to rank a user's influence
sentdex
GPIO Tutorial for Pi Part 2 - Programming the GPIO
sentdex
GPIO Tutorial for Raspberry Pi Part 1 - Setting up
sentdex
More on: Frontend Performance
View skill →
🎓
Tutor Explanation
DeepCamp AI