wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!

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

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 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
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

Related AI Lessons

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