#326: Building Desktop Apps with wxPython Transcript
00:00 Did you know that I'm a fan of GUIs? You know, they're kind of like web pages,
00:03 but they run on your computer, they have their own windows, and you can even use those applications
00:08 offline. On this episode, we'll dive into WXPython with Mike Driscoll. He's back on the podcast to
00:15 share his hard-won experience building and distributed Python window-based applications.
00:20 This is Talk Python to Me, episode 326, recorded July 14th, 2021.
00:26 Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem,
00:44 and the personalities. This is your host, Michael Kennedy. Follow me on Twitter, where I'm @mkennedy,
00:49 and keep up with the show and listen to past episodes at talkpython.fm, and follow the show on Twitter via at Talk Python. This episode is brought to you by Linode,
00:59 us over at Talk Python Training, and the transcripts are brought to you by Assembly AI. Please check out
01:04 what we're all offering during our segments. It really helps support the show.
01:07 Do you want to learn Python, but you can't bear to subscribe to yet another service?
01:12 At Talk Python Training, we hate subscriptions too. That's why our course bundle gives you full access
01:18 to the entire library of courses for one fair price. That's right. With the course bundle,
01:23 you save 70% off the full price of our courses, and you own them all forever. That includes courses
01:29 published at the time of the purchase, as well as courses released within about a year of the bundle.
01:34 So stop subscribing and start learning at talkpython.fm/everything.
01:41 Mike, welcome to Talk Python to Me.
01:43 Yeah, thanks so much for having me again.
01:44 Yeah, it's great to have you here. Maybe we can just remind people of the last time you are here.
01:49 You wrote a really cool book called, I think it was Python Interviews. Do I have the title correct?
01:54 Yes, that's correct.
01:55 Yeah, and that was back in episode 156, way back in 2018, three years ago, I guess, more than that.
02:02 But it was a history book, so I was looking back, right? It's fine. It's still relevant. People can
02:07 check that out. And I really love some of the stories that you told on there. I love, I think it was Alex
02:13 Martelli. You interviewed him and talked about how Google Video and YouTube were sort of competing neck
02:20 and that was sort of a Python versus C++ story. That's probably the one that stuck with me the most.
02:25 Yeah, I really enjoyed that one. Although there's some good stuff in the Brett Cannon interview as
02:29 well.
02:29 Yeah, there's great stuff all over. I'm just trying to think of the one that I can remember years later,
02:34 you know?
02:34 Yeah.
02:35 Yeah. So it's been a couple years since you've been on the show. What have you been up to?
02:39 Well, since that book came out, I have been pretty prolific in my writing and continue to write
02:45 more Python books. For example, I've written one on WX Python and Report Lab. I redid Python 101,
02:52 which was my first book.
02:53 Report Lab is about like working with PDFs, right?
02:56 Yes. You can use it to create PDFs. But that book also covers how to edit, or I shouldn't say edit,
03:01 how to read and get data out of an existing PDF as well.
03:05 Yeah. Cool. You got a couple of 101, 201 type of books as well.
03:11 Yes.
03:11 Like learning Python.
03:12 Yep. Python 101 is for beginners and 201 is kind of intermediate advanced.
03:16 So if I was like a sophomore, I might take that.
03:18 Yes.
03:19 Cool. So what are you doing these days? Are you doing the independent thing with your authoring
03:25 and creating? Are you doing consulting? What are you up to?
03:28 Oh, I still do a full-time job. I write Python code that tests an embedded C++ application with Python.
03:34 Oh, nice.
03:35 It's really neat. But I also, you know, kind of as a hobby slash side job, I write for myself. I write
03:42 these books and I occasionally contribute to RealPython as well.
03:46 A lot of good stuff going over RealPython. Dan and crew keeps that content flowing over there for sure.
03:52 Yep.
03:52 Yeah, absolutely. So we're going to talk about building GUIs or GUIs as some people say them. I don't know.
04:00 Are you a GUI or are you a GUI sort of person?
04:02 I usually call it GUI.
04:04 Yeah, me too. So we're going to talk about those for Python, which I think is interesting because there are,
04:09 there have been, there are decent options, but it's not a place where Python has traditionally received a ton of focus
04:16 and energy on building. A lot of these frameworks have to do with picking another framework that's a nice
04:22 cross-platform framework and like making it friendly for Python, right? I'm thinking of like PyQt or even WXPython, right?
04:29 Yeah, it's usually a C++ wrapper that preexisted Python and then it got wrapped with bindings of some sort.
04:36 Yeah, exactly. A lot of these, especially the ones that do native widgets, those are really just wrappers
04:41 over the operating system when doing APIs, right? Like Win32 or what is it? Coco on macOS, those kinds of things,
04:51 right? So it's like some thin layer than some adaption adapting thing for Python, right?
04:56 Yeah, I think there's only a handful that aren't wrapping something else. Like BeWares Toga,
05:02 I don't believe is wrapping the native, I was trying to look, I guess it is wrapping in a way,
05:07 but it's not wrapping a preexisting framework.
05:10 Right, right. It's probably super low level. Like here is a, literally create a window that is a button
05:16 and that's it. Like not like Qt or something. Yeah, I think Toga is actually like, you know,
05:22 trying to render the Coco widgets or the Win32 widgets itself, you know, rather than calling like
05:27 Qt or WX.
05:28 Yeah, there's some value to that. There's some value to that. So I thought the place that we could start
05:33 is maybe a survey of these different libraries that we could use.
05:37 Sure.
05:37 Right. And so let's start with Tinker, TK Enter, which is really the Python interface to TCL,
05:43 TK, right?
05:44 Mm-hmm. Yeah.
05:45 So this one comes built in, right? I'm here on the Python 396 documentation. And I guess this is the
05:53 official way to create QIs with Python, right? I mean, in the sense that it ships with it.
05:58 It ships with it. However, on like Linux, the system Python does not come with it.
06:04 Okay. So you still got it.
06:05 And I believe, I believe Mac is the same way. You have to install it separately for its system Python
06:10 too.
06:10 Yeah. That wouldn't surprise me. Well, you know, the system Python and Mac is all sorts of outdated and
06:16 whatnot, basically, right? Like 2.7, who knows what, right? But-
06:22 Yeah. But it always surprises me when I go to import TK Enter and it's like, oh, it's not there.
06:25 Like, what the?
06:27 Yeah, exactly. Tell us about this one. Like, what's the good side? When would you use it? Or
06:32 would you use it? When wouldn't you use it?
06:33 I don't like it because it looks a little old-fashioned, but mainly because it draws all its
06:39 own ridges, just like some of the other GUI toolkits. So basically, when you create a TK Enter GUI,
06:45 you know it's a TK Enter GUI because it doesn't look native. However, you can use a TK Enter,
06:51 the code can be written without classes. You could write it completely functionally,
06:56 and still make it work. So, you know, as a learning way to create a GUI, it might be a good first,
07:02 you know, a good beginner or first GUI to create with.
07:05 Yeah, absolutely. Here, I put up on the screenshot, the screen for us to see there's like this TK Enter hotel
07:11 management system. It definitely doesn't. I didn't see the top bar. I couldn't tell you what OS that's
07:16 from, but because it doesn't look like any OS that I know, right? Although there's another example. I'll
07:21 put these in the show notes. There's a pretty nice one that's hosting some kind of, it's like a predate
07:28 jupiter or something like host map plotlib exploration and stuff. And that looks like a
07:34 pretty solid app to me.
07:35 Yeah. TK Enter did add a submodule called TTK, which does look a lot more native across platforms.
07:41 You can make it look nice, actually, if you spend the time, but you're going to have trouble
07:46 finding good examples online because a lot of them just use the old interface. And one other thing I do
07:52 want to note about TK Enter is it's themable. So if you want it to look, you want to add themes to
07:57 your GUI, you want to take it as an option for that.
08:00 Oh, interesting. It was like, so for example, you could give it a macOS like theme that turns
08:05 on on that platform and a Linux theme, maybe dark mode and a not dark mode.
08:11 Yeah. I was thinking of dark modes, light modes, be giving them a certain color things,
08:14 kind of like a Winamp type skin.
08:16 Yeah. Oh man. Remember how crazy those skins would get? They'd get like 3D with little holes
08:21 cut in them. And yeah, that stuff got, that got a lot of little drawers, like an alien tongue
08:26 would shoot out. And that's where like the playlist would be. Don't do that people.
08:29 Yeah. Don't do that.
08:30 Okay. So for the most part, TK Enter is built in ish. At least it's sort of somewhat officially
08:37 part of Python, right?
08:38 Yes, it is.
08:39 Another one, one that I think of a lot when I think of cross-platform stuff is Qt, Qt and PyQt.
08:46 There's been a lot of different versions of PyQt. There's been a lot of stuff with licensing.
08:52 So like right here on the homepage, it says licensing. PyQt is dual license on all the
08:56 platforms under DPL3 and the Riverbank commercial one. Unlike Qt, PyQt is not available under LGPL,
09:03 which is, I guess what you would need for like a commercial closed source app. And then there's,
09:08 there's another wrapper around Qt that I think is LGPL. Like the, there's a lot of stuff that's
09:14 just like, whoa, why is it so complicated?
09:16 Yeah. PyQt is kind of confusing when it comes to its licensing structure.
09:20 Yeah. Which is crazy because I've had this conversation multiple times and it seems like it,
09:25 I don't know, it either, it never resolves clearly in my mind or it's just challenging. But that said,
09:31 there's really nice apps built with Qt. So for example, like one of the database tools I use for
09:37 working with MongoDB is Robo3T. And if you look at Robo3T, this thing is glorious in terms of its sort
09:44 of native look and feel. Like if you go to the robomongo.org, scroll down for the screenshots,
09:49 there's the three OSs side by side and every one of them looks like it belongs on that platform,
09:55 right?
09:55 Yeah. You can get a little bit simpler with, instead of using PyQt, you could use Qt for Python,
10:00 which is the new name for PySide.
10:02 That's right.
10:02 That's right.
10:03 And it has a bit more permissive licensing structure.
10:05 That's the one I was thinking of. Yes. Thank you. Yeah. They renamed that to Qt for Python,
10:10 right?
10:11 I believe so. Although the import is still PySide.
10:13 Is it still PySide? How interesting.
10:15 It's like PySide 6, I think. Yes.
10:17 Yeah. How interesting. So this, I think Qt's a pretty solid option. I feel like I see Qt being
10:23 used in embedded systems and other types of things. Like I said, I started using RoboMongo just because
10:28 it seemed like a good app and like, oh, this is a Qt app. It's not a Python. It's a C++ app,
10:34 but it just as well could be. Like there's nothing fancy about it that it makes it have
10:38 to be C++. It just happens to have been that way. Yeah. Yeah. So what are your thoughts on
10:42 this as one of the options? Oh, Qt is really powerful. You can do a ton. And while it draws
10:49 all of its own widgets itself, it's not actually using the native widgets. It looks native.
10:54 At least they made an effort. Yeah. Yeah. Again, this one is also a themable. If you want to do themes,
10:59 you can change, you know, dark mode, light mode easily because that's all drawn itself.
11:04 I think PyQt and PyQt for Python both support QML, which is kind of an XML version of the C++ library.
11:12 So you can kind of write it, write your GUIs in a markup language.
11:17 Yeah, that's right. It's a little bit like XML or XAML from the Microsoft space. Yeah, that's right.
11:22 It also has a, what you see is what you get editor. I think it's Qt Designer.
11:27 It works for both C++ and Python. I believe the Python side, you have to do some special imports
11:33 to actually use the UI file it generates. Yeah. That seems like a really valuable thing to me
11:38 to visually be able to say, I want this widget to be here. I want this one to stretch like that and so
11:42 on. Yeah. I work with a bunch of C++ cute guys and they use the designer, but occasionally it will do
11:49 crazy things when your design gets really complex, where it's really hard to get stuff to stretch the
11:55 way you want it to. And sometimes you just have to drop into the code to make it work right.
11:59 Yeah. Well, I think that's probably the case with many of the frameworks, right? Not just these Python
12:04 ones we're highlighting, but you know, Xcode, whatever, right?
12:08 I think that's just a problem with auto-generated UI code. Whenever you use a designer like that or
12:13 Visual Studio, you're going to run into quirks.
12:16 Yeah. Yeah, for sure. Next up on our list here is Kivy. Kivy, I heard about a lot from sort of
12:23 building mobile apps with Python in interesting ways. It's kind of got this game, draw your own UI
12:29 sort of feel to it.
12:30 Yeah. It's also cross-platform. It runs on mobile too, though. So you can deploy its apps to Android and
12:38 Apple OS. But yeah, a lot of the stuff on there... Well, I should back up. It was originally developed
12:43 for multi-touch. So like Microsoft's original Surface table, I think is what it was originally developed
12:49 for. Yeah.
12:50 But, you know, obviously it also works great on multi-touch phones and whatnot. But yeah, all of its widgets are
12:57 drawn by Kivy itself. So they look like a Kivy app most of the time.
13:01 Yeah. They have a gallery over here. And in the gallery, they even have like some surface table
13:07 exploration stuff, like the city of Marseille map exploration type thing, right?
13:12 They have a Kivy garden, I believe, that also showcases lots of custom widgets.
13:16 Yeah. So when I look at the... I'm scrolling through the gallery here, I feel like there's a lot of 2D
13:23 sort of interactive things, a lot of games or stuff like that, right? So it's... If I wanted to build an
13:30 app that maybe looked like it used the Windows rich text box and the Windows button, so it looked like
13:36 a, I don't know, a Windows 10 button on Windows 10 and a Windows 11 button with curved edges.
13:42 It's not that kind of framework, right?
13:44 No, it's not.
13:45 Okay.
13:45 And I believe Kivy is based on, or written on top of Pygame. So it has... That's why I can do games so well.
13:52 Right. That sounds familiar to me as well. And apparently the winner of the Python Discord
13:56 Code Jam 6 was done in Kivy. So that's pretty cool.
14:01 That is cool.
14:02 As well as second place.
14:03 So I was unaware.
14:04 Is there a third place one down here?
14:06 Yeah, it is.
14:07 Wow.
14:08 They have a clean sweep of the podium with Kivy. So that's pretty impressive, actually.
14:12 Yeah. I've actually played one of their games on my phone before and they seem pretty well
14:16 done.
14:16 Nice.
14:17 Another one that's gotten a lot of traction and has its own opinions for how it works is
14:23 PySimple GUI. I think Mike Barnett, if I'm remembering correctly, is working on that.
14:29 Yeah.
14:29 And yeah, the idea is to make it super simple to just get a basic UI up and running, right?
14:35 Yeah.
14:35 So PySimple GUI wraps, I think, four or five other frameworks. So it wraps tkenter, WX Python,
14:43 PyCute, Remy, which is a mobile thing, and something else. And basically it gives you the same API for
14:50 all of them. So that, you know, if you write your code once and then you just change the import from
14:54 import PySimple GUI to import PySimple GUI Qt or PySimple GUI WX, you can get that native look and feel
15:02 because you're using WX acute.
15:04 Oh, that's a really cool aspect, right? That you can swap out the widget engine or something,
15:10 basically.
15:10 Mm-hmm. Yeah. The default is tkenter.
15:13 Yeah. Probably because it's the least dependencies and you don't have to think about which kind of
15:18 license you're doing what with.
15:19 Yes.
15:20 Interesting. Okay. So this is a pretty cool one. If you're just trying to get a dialogue up that
15:26 has one or two buttons and an input and a progress bar, maybe this is a good option.
15:30 They can do quite a bit of complex GUIs too. There's a demo package that they have that
15:35 shows how to integrate it with matplotlib and opencv and lots of other things. These examples
15:42 don't show the advanced stuff it can do.
15:44 Right. I'm just sort of paging through the gallery, the screenshot they have on the site
15:50 there, which we'll link to.
15:51 And again, since it's using tkenter, it also does themes natively.
15:55 Yeah, it can just float.
15:56 At least for the tkenter part.
15:57 Yeah, exactly.
16:00 This portion of Talk Python to me is sponsored by Linode. Visit talkpython.fm/Linode to see why Linode has been voted the top infrastructure as a service provider by both G2 and TrustRadius.
16:11 From their award-winning support, which is offered 24-7, 365 to every level of user, to the ease of use and setup, it's clear why developers have been trusting Linode for projects both big and small since 2003.
16:24 Deploy your entire application stack with Linode's one-click app marketplace, or build it all from scratch and manage everything yourself with supported centralized tools like Terraform.
16:34 Linode offers the best price-to-performance value for all compute instances, including GPUs as well as block storage, Kubernetes, and their upcoming bare metal release.
16:44 Linode makes cloud computing fast, simple, and affordable, allowing you to focus on your projects, not your infrastructure.
16:52 Visit talkpython.fm/Linode and sign up with your Google account, your GitHub account, or your email address, and you'll get $100 in credit.
17:00 That's talkpython.fm/Linode, or just click the link in your podcast player's show notes.
17:06 And thank them for supporting Talk Python.
17:08 One that you put in the list that I haven't really done anything with is DearPyGUI, a fast and powerful graphical user interface toolkit for Python with minimal dependencies.
17:20 Tell us about this one.
17:21 This one I haven't played with very much yet, but I believe the guy who created it has been working a lot on it lately, and it has a really neat interface.
17:30 I don't think it's wrapping anything, but I could be mistaken.
17:33 It looks very focused on providing animated and interactive aspects for scientific visualization and exploration.
17:42 Yeah, I think it is.
17:44 I don't believe it tries to look native necessarily either, but it has a very slick interface.
17:49 Yeah.
17:49 Yeah, it does.
17:50 There's a lot of cool stuff that's going on here.
17:52 Okay.
17:53 So that's a neat one.
17:54 And I guess one that I didn't properly cover yet, because I didn't pull up in our little list here, but it's a toga from Beware.
18:02 You touched on that, right?
18:03 Yeah.
18:04 So all this stuff over at Beware is super neat.
18:07 There's a lot of nice things going on.
18:09 It definitely, the native widgets feels, and I just always feel kind of like, ah, this thing doesn't really belong here, right?
18:16 When I see an app, it just looks like you're like, this is, you know, some clearly cross-platform, not really this platform feel, right?
18:25 Yes.
18:26 I don't know.
18:26 I appreciate the native widgets aspects, but it's also listed in sort of the maturity level as early development, right?
18:32 So I'm not sure if this is pretty for you to pick up and build with yet.
18:36 Yeah, not really is my understanding.
18:38 And oddly enough, it's been in early development for like the last five years.
18:42 Yeah.
18:42 So it's been really slow to develop.
18:44 They're trying to do it from the ground up and they're not wrapping anything.
18:47 It's somewhat understandable, but I think they recently added Android support.
18:51 So I think that they're focusing more on the mobile stuff than, you know, like Windows and Macs, native OSs.
18:58 Yeah.
18:59 The last commit was a merged PR from Russell Keith McGee four days ago.
19:04 So there's still, still action.
19:05 Yeah.
19:06 Yeah.
19:06 They're still working on it.
19:07 All right.
19:08 Well, that brings us over to the WX Python, which is another one of these options in this space,
19:14 but that's what we're going to focus on in this particular episode, right?
19:18 Sure.
19:18 Yep.
19:18 So give us the quick overview of WX Python sort of compared to these other options we've been covering.
19:23 So WX Python is again, a C++ project.
19:27 It wraps WX widgets or Wix widgets, I've heard it called.
19:31 It works on Windows, Mac and Linux and Raspberry Pi.
19:34 The big thing about DAPX Python is that it does do native widgets wherever possible on all platforms.
19:41 Yeah, that's cool.
19:41 So that is really cool.
19:43 It also provides a lot of custom widgets in case you need them for certain purposes.
19:48 Like some, I believe, I think it was Mac that didn't have a toggle widget for a long time.
19:53 So they provided their own toggle widget for it.
19:56 Right.
19:56 It's the GUI equivalent of a polyfill.
19:58 It's like that feature is not supported, but you want it.
20:01 Well, like, all right, here's that something that'll do for now.
20:04 Yeah.
20:04 Yeah.
20:05 Very cool.
20:05 You know, it looks to me like it checks a lot of the right boxes.
20:09 What's the licensing story?
20:11 It's very permissive.
20:12 Yeah.
20:12 I'll pull up there.
20:13 I'll pull up the repo and hit their license doc and see what I can find.
20:17 I know they called it the WX Python license, but I'm trying to remember.
20:21 Ah, that's right.
20:21 It looks LGPL-ish.
20:24 Yeah.
20:24 I think it is mostly LGPL.
20:26 Mm-hmm.
20:26 Yeah.
20:27 Cool.
20:27 That's better than multi-license confusing.
20:31 Like the C layer has one license and the Python layer has another license, but then there's
20:35 this other commercial license.
20:37 So it seems like it's pretty easy for you to just decide to adopt it and use it on your
20:41 project.
20:41 Yeah.
20:42 I would agree with that.
20:43 And it's also extremely stable.
20:45 They almost never break your code when they release a new version.
20:50 Okay.
20:50 That's cool.
20:51 I heard that it rose from the ashes.
20:52 Yeah.
20:54 The Phoenix release and then the legacy or traditional version.
20:59 What's the story of that?
21:00 So, you know, Python 3 came out and a lot of people, you know, fussed about supporting it.
21:05 It was a pretty big deal to port WX Python to Python 3 because WX Python has a really small
21:13 group of core developers.
21:14 But eventually he created, or Robin Dunn is the main guy behind WX Python currently.
21:19 And he decided, well, we're going to call it Project Phoenix while I get this working.
21:24 And I think he actually switched the way he binded to Wix widgets at the time because he
21:29 went from like SWIG to, I believe, SIP, which is a different type of binding.
21:33 Okay.
21:34 And that made it a lot easier to support both Python 2.7.
21:37 And I think it was 3.4 was the first release for Wix Python.
21:41 And that also made it pip installable.
21:44 So that was super awesome when he got that working.
21:46 So if I want to use it, I can just pip install DevX Python or Wix Python.
21:50 As I'm learning that I might want to say it that way.
21:53 Yes, that's correct.
21:54 And there's a caveat on Linux that sometimes you need to have a couple of extra Linux dependencies
21:59 installed.
22:00 But other than that, pip install should work.
22:03 Yeah.
22:03 Well, that's pretty standard, right?
22:05 If you're doing GUI stuff on Linux, a lot of times there's elements there you got to add.
22:09 It doesn't seem outrageous.
22:11 No.
22:11 Yeah.
22:12 So another thing that I'm a big fan of to the extent that they work, and the better that
22:17 it works, the more I'm a fan of it, is the GUI designer.
22:21 So there's two over here, right?
22:23 We've got like this Wix form builder in the Wix Glade.
22:27 I think I tried the Wix form builder and it just, it kept crashing.
22:31 Not like it would start and was unstable.
22:33 It would not start for me.
22:35 And I don't know what the deal, maybe it was the version of macOS I was running on or something.
22:40 But what's the story?
22:41 Are these things that people would use?
22:43 Yeah.
22:44 What's the story around the WYSIWYG side of these?
22:47 WX Python traditionally hasn't had really a WYSIWYG editor, but people have tried to build
22:53 them.
22:53 So I think Wix Glade is probably the one that's been around the longest.
22:56 Okay.
22:57 And probably the best supported.
23:00 I don't think it, I think it supports the core widgets of WX Python.
23:03 If you were to pull up the WX Python demo app, there are like a hundred, I would say at least
23:08 a hundred widgets, maybe more, maybe 200.
23:10 So the core widgets, you know, like buttons.
23:13 Do I find that under widgets?
23:14 You would find that under, let me see, downloads.
23:18 Downloads.
23:19 There you go.
23:19 Unfortunately, it's actually something you run.
23:21 Yeah, sure, sure.
23:22 So if you can download, I think I have run that before and you basically, it's like got all
23:27 these windows that'll show you little use cases for this widget or that widget, right?
23:31 Yeah.
23:31 It also shows you the code and you can edit the code live in the demo and see how it, how
23:35 it changes the widgets.
23:37 Oh, that's neat.
23:37 It does a decent enough job.
23:39 I think it outputs a Python file.
23:41 So that's nice.
23:42 I mean, it doesn't put, you know, like Qt's designer output's a UI file that you have to
23:46 figure out how to import and then use.
23:48 This one actually outputs a Python file.
23:51 Oh, that's nice.
23:51 Yeah, that's really good.
23:52 So I'm looking at the screen here and it looks like Audacity, the well-known audio editing
23:58 app is built in DubX.
24:00 I'm guessing.
24:01 Otherwise, there's no reason they would feature it.
24:02 I believe that's true.
24:04 I'm not sure if it's Wix widgets itself.
24:06 Yeah, it's on the Wix widgets site.
24:08 So I'm pretty sure it's a C sort of thing.
24:11 But yeah, these are pretty good looking apps that you can like sort of page through all their
24:15 screenshots on just Wix widgets.org.
24:18 Almost even like an auto trader looking thing and like a diff tool.
24:22 Yeah, file merge.
24:23 Yeah, Audacity.
24:24 Yeah, I believe one of the Linux diff tools is written with WX Python.
24:28 And I had heard that the Dropbox UI was written with WX for a while.
24:33 I don't know if it still is or not.
24:35 Cool.
24:35 So it seems like there's quite a rich library for working with these things with WX Python
24:41 or Wix Python.
24:42 And I guess maybe one of the nice ways to explore this would be, where am I going to
24:48 go?
24:48 I'm going to go over here a little bit.
24:49 To talk about sort of some of the things you covered in a recent book that you wrote.
24:53 Not super recent, but somewhat recent.
24:55 Creating GUI applications with Wix Python, which is pretty cool.
24:59 And a comment from the live stream out there.
25:02 Juergen says, congrats on the successful fundraiser for your latest book, which is not this book,
25:07 but like...
25:08 No.
25:08 What book is that that you're just working on now?
25:10 I'm working on one that talks about automating Excel with Python using OpenPy Excel.
25:16 Well, that's certainly a hot topic indeed.
25:18 What's the story with this creating GUI apps with Wix Python in your book?
25:24 Feels like from the extent that I got to read it, which is not all of it, but some of it.
25:29 It does a quick introduction of how to work with the widgets and stuff and get some stuff
25:34 on the screen, understand the layout a little bit.
25:37 And then it goes through and just builds like a bunch of different apps, like a nice little
25:41 image viewer, a database viewer tool that uses SQLAlchemy to like explore stuff there,
25:47 a calculator, an archiver, MP3 tag editor, those types of things.
25:51 You want to maybe just tell us like kind of some of the key elements before we actually,
25:56 before we get into those, let's just maybe, it's hard in code, but on audio to talk about
26:01 code, but maybe just give us like a sense of what is it like to get a window and a button
26:07 on the screen or something like that?
26:08 Sure.
26:09 So, you know, Linux Python, much like PyQt, they're all class-based.
26:15 So, you're going to be inheriting from different classes to create all the widgets online.
26:21 Whereas with Tcancher, you don't have to do that.
26:23 I see.
26:23 So, you might make like a window class and like a layout main section class or something like
26:29 that?
26:29 Kind of.
26:30 Okay.
26:31 Layouts usually aren't needed to be subclassed, but like you subclass a frame, which is the main
26:36 window.
26:36 You can subclass a panel, which is kind of like the tabs on your Firefox or Chromebook.
26:45 You can create a notebook object that has multiple panels when each of those panels is a tab,
26:50 basically.
26:51 I see.
26:51 So, it has like a multi-doc version or style that it'll support.
26:55 Correct.
26:55 Yeah.
26:56 Okay.
26:56 Cool.
26:56 And within your frame, you have your panel.
26:58 And then within the panel, you have your widgets.
27:00 And so, those are your children widgets.
27:02 Like you have your buttons or your, you know, your scroll bar or your check boxes or whatever.
27:08 The code can get kind of unruly, but for just creating something really simple, you can do
27:13 it in less than a hundred lines of code most of the time.
27:16 But, you know, once you start doing like anything complex with WX Python, you're going to start
27:22 adding a lot of code.
27:23 Right.
27:23 Because if you're going to have, say, three buttons and a text field and you want to,
27:28 you want to figure out how they lay out, there's like a couple of things that you're going to put
27:31 just on the layout side.
27:33 And then you're going to have to hook potentially the events.
27:35 You can abstract that away a little bit.
27:37 So, it's not too bad.
27:38 Like if all the buttons do something similar, then you can make that really short.
27:42 But yeah, if you, if all the buttons do something completely different, then you could, you know,
27:47 you have three different functions.
27:49 The way I have written wrappers to make laying that stuff out simpler.
27:53 So, I don't have to repeat the same boilerplate.
27:55 Yeah.
27:55 All the time.
27:56 Yeah.
27:56 As soon as you're like, why is this so complicated?
27:58 Why do I keep doing this?
27:59 Maybe that's the time to think about how do I do it just one more time with a little more
28:03 polish and then never again.
28:04 Yeah.
28:05 Yeah.
28:06 So, the widgets have events, right?
28:09 Like on a Windows, it'd be like a WM key down, like win32 event that is then translated to
28:16 the Wix event, which then calls back into, say, Python, right?
28:20 And what you do is you give it just either a class level or just a regular function.
28:25 Whenever somebody clicks this button, call this function, right?
28:28 Yes.
28:28 It's usually like for buttons, it's like WX.event button, and then you just bind it to a function.
28:34 Right.
28:35 Or you could bind it to the entire app if you wanted to, so it captures the clicks.
28:39 Yeah.
28:40 Yeah.
28:40 What I thought was interesting looking through the framework was in many UI framework, like
28:45 native compiled built-in frameworks, they don't, basically the button gets a click or it doesn't,
28:53 or somebody clicks the thing outside of it or it doesn't.
28:56 But in JavaScript, we have like bubbling events that go up and down.
29:00 So, if I click on a label, but the label doesn't handle it, like, but somewhere higher up, maybe it's in a div and the div is handling the event, like that would catch it, right?
29:09 So, you have this ability to say, go up until it's the right level to deal with this action.
29:14 And it looks like WX Python has that as well.
29:16 Yes, it does.
29:17 Yeah.
29:17 Yeah.
29:17 That was a little surprising that you can sort of bind the same event at different levels and then either capture it or let it keep flowing up.
29:25 So, they both get hit, I guess.
29:27 Yeah.
29:27 You can do that and you can, you know, execute your event and then you can say, I think it's event.skip.
29:31 Yeah.
29:32 And it'll go to the next level.
29:33 Right.
29:33 That's like, don't let me consume the event.
29:35 Let it keep going.
29:36 Mm-hmm.
29:36 Bubble it up or something.
29:38 Yeah.
29:38 Yeah.
29:38 Really nice.
29:39 So, one thing that you talked about that I thought was interesting before we get into maybe a little more detail is you talked about, it's really nice to have a conception of what your app is going to look like, especially around layout, right?
29:51 Mm-hmm.
29:52 Yes.
29:52 So, you recommended, well, one is just like writing stuff out on paper, which is always good.
29:58 We also recommended using Balsamic as something where you could potentially sketch out the UI.
30:03 Yeah.
30:04 I really like Balsamic because it just makes, it makes laying stuff out kind of a breeze.
30:08 You could also, you know, you could use that cute designer because it's free and open source.
30:12 You could use that to lay, to draw a layout too.
30:15 Right.
30:16 Even though your destination is not ultimately cute.
30:18 Correct.
30:18 But it still lets you drag the widgets around, right?
30:21 Yeah.
30:21 So, you could still get a good idea of what you want it to look like using that.
30:25 Yeah.
30:25 I guess if you had a really old version of Visual Basic laying around.
30:28 Yes.
30:28 That also works.
30:29 I thought about that.
30:30 The VV6.
30:32 I mean, that thing went out of support like in the 90s, but you might get it to run.
30:36 But yeah, the Balsamic one.
30:38 I really like this.
30:38 I've used this for prototyping a couple of things.
30:41 I think I used it a lot when I was building the Tuck Python training platform and stuff like that.
30:45 But it's one of these wireframe type of tools that like specifically is not meant to look native or finished.
30:54 Right.
30:55 It kind of looks as if you had drawn it by hand.
30:57 Like the web browser, it's sort of wiggly lines as if you had sketched that out.
31:01 Right.
31:01 I like this thing a lot.
31:03 It's a good recommendation.
31:04 Yeah.
31:04 I really like it.
31:05 It's not super expensive and it does a good job of sketching the ideas that you have in your head.
31:10 Yeah.
31:10 For sure.
31:10 A couple of live stream comments.
31:12 Just to get a quick shout out to you.
31:14 Alexander says, interesting.
31:15 Sounds like React in Python when we're talking about the event bubbling.
31:18 Yeah.
31:18 Very cool.
31:19 And then David has equated you to Brian Okken.
31:22 Mike is to Python GUIs as Brian Okken is to pytest.
31:26 Yeah.
31:26 So really cool.
31:28 I guess one more general concept let's talk about a little bit before we maybe just touch
31:32 on some of the lessons and whatnot from the various apps and the types of things that people could
31:37 go play around with.
31:38 And I'm guessing the source code for these apps is on GitHub available.
31:42 Even if people don't have the book, they could probably go dig it up.
31:44 Yes, it is.
31:45 Yeah.
31:45 Same.
31:46 Same for all my stuff.
31:46 And the extra thing that I really want to talk about is layout.
31:50 So layout's interesting, right?
31:52 You've got these different, what are they called?
31:55 Resizers?
31:56 Resizers, yes.
31:57 Yeah.
31:57 So if you're going to put like two buttons next to each other, then you just want them to
32:02 take up 80% of the space combined and have a little bit of margin or something.
32:05 If you just put them in a location, well, that might be true for their size at first.
32:10 But if you move the window, obviously not so much.
32:13 All right.
32:14 Yeah.
32:14 They'll just stay there.
32:15 They're not going to move.
32:16 They're not going to change size.
32:17 Talk about the different layout sizers and how you can combine them.
32:22 How do you build like real composed UI worlds with this?
32:26 You know, you could use absolute positioning.
32:28 I don't recommend it.
32:29 But if you made your frame unresizable, then you could totally do that.
32:33 Yeah.
32:34 But if you want to use sizers, I usually use box sizers.
32:37 They support vertical or horizontal alignment.
32:41 So if you set it for vertical, which I think is the default, it will add the widgets from left to right across, I mean, horizontal.
32:48 I get myself all confused.
32:49 All right.
32:50 Vertical is top to bottom.
32:51 Horizontal is left to right.
32:53 So as you add them, the widgets will stack in that direction.
32:56 And the nice thing is you can nest the sizers.
32:58 So if I wanted to, you know, add columns, I could put, you know, three or four vertical sizers, box sizers inside of a regular horizontal sizer or vice versa to just create these kind of stacks of widgets on my UI.
33:13 All right.
33:13 So let's think about this.
33:14 So imagine I want to build like a photo viewer thing and I want on the left, I want a vertical list of all of the image names, you know, just the short image names, then maybe folders.
33:28 And I click the folder and then in the right, I get like a grid of photos.
33:32 So overall, I've got the panel and then I would put a vertical sizer that has the two pieces, right?
33:40 Yes, probably.
33:41 The one on the left would be another vertical sizer that just takes a bunch of like little image name display and things.
33:48 And on the right, maybe a horizontal one.
33:50 Or does it have to wrap?
33:51 Would that wrap around?
33:52 Or would it just shoot off the screen to the right eventually or make them really small or something like that?
33:56 It should make them smaller if you make it too small.
34:00 But you can also set size hints in Dabix Python that says, do not reduce this window beyond, you know, like 400 by 400 pixels or whatever it is.
34:09 Okay, just get like a scroll bar or something like that.
34:10 Yeah, you can tell.
34:11 So that's actually a different widget.
34:13 There's a scrollable panel that you could add.
34:16 And then the scroll bar will appear when you resize as appropriate.
34:21 Right.
34:21 Okay.
34:21 Another way you could do that is use a splitter window and then have your widgets, some widgets on the right and some on the left.
34:27 Interesting.
34:27 Okay.
34:27 So you really have to probably think about how do you compose these things, though?
34:31 There's not like one super duper layout that's just going to do all this stuff.
34:35 You're like, here's a section.
34:37 There's a section, right?
34:38 Yeah.
34:38 I mean, there is a flex grid sizer and a grid sizer.
34:41 So if you know your layout is going to be kind of in a grid shape, you could use one of those grid sizers and lay them out that way.
34:48 They're a little bit confusing to work with at first because you're trying to figure out, you know, where does everything go?
34:53 They work great for like a calculator because that's a grid.
34:56 Right.
34:56 Okay.
34:56 But.
34:57 And they're probably not changing.
34:58 It's a fixed number of nine or whatever.
35:01 Yeah.
35:02 Things are going in there.
35:02 And you could nest, you know, box sizes inside of the grids to make, give yourself more flexibility.
35:06 Mm-hmm.
35:07 Make the return button bigger or something like that as it stretches.
35:10 I believe you can make each cell in a grid sizer stretch differently.
35:13 So you don't actually need to do the nesting.
35:16 I was thinking more like if you needed to like have stacks of widgets in a cell within the grid sizer, then you might need to put a different sizer inside of it.
35:24 Yeah.
35:24 Okay.
35:25 Very neat.
35:26 Quick feedback from the live stream.
35:27 Matt Robinson says in my last company, we used a bunch of Wix Python.
35:30 Your book was an awesome resource.
35:32 Super cool.
35:33 Oh, cool.
35:33 Awesome.
35:34 Yeah.
35:34 Yeah.
35:34 Very good.
35:35 All right.
35:35 Now let's go on and talk about some of the apps in your book because I think, you know, thinking about like what are the kinds of apps I could build with this framework reasonably and stuff that fits in a book usually has to fit that reasonable category.
35:48 It's not like, well, we're going to build Microsoft Word and like, you know, something that does a zillion things.
35:54 So let's see the first one that you had there was really the first meaningful one was like an image viewer, which is a little bit like like a simpler version of what I'd sort of just described.
36:06 Right.
36:06 Yes.
36:06 I chose the image viewer because I know it wouldn't take a lot of code to create something that just shows you an image on screen.
36:12 And because JPEG's Python uses pillow underneath, it can support most image types natively, which is really handy.
36:20 Yeah.
36:20 It supports, you know, the list is like seven or eight different formats, ping, JPEG, GIF and on and on.
36:27 Right.
36:27 Which is something that TK Enter doesn't do.
36:29 It only supports like two or three natively.
36:31 And then you have to import pillow.
36:32 Yeah.
36:33 Give us a BMP and you're like, how do I get a BMP?
36:35 Like in a TIFF?
36:36 Like where did it?
36:36 Yeah.
36:37 It gets very unhappy if you do that.
36:39 Yeah.
36:40 That's cool.
36:40 And then it started out as just, you've got a button that says choose a file and then you show it on one of these, these image widgets, which is pretty straightforward.
36:50 But, you know, I was still impressed that when you click the button, it's like a really clear way to open a dialogue that is the native dialogue.
36:57 So in your case, you used your Mac file dialogue and it has like all the stuff you'd expect on the left.
37:03 It's got like your favorites and your tags and, you know, whatever customizations you've done to your binder, whatever.
37:09 Yeah.
37:10 Because JBS Python does their native.
37:12 Exactly.
37:12 And it's always drove me crazy that like, oh, I know on the real OS, I can navigate to another folder this way, but now I'm just hitting the up arrow over and over again.
37:21 And, you know, it's just those little things, you know, they just, it's nice to have it native.
37:26 Yes, I agree.
37:27 I feel your pain.
37:28 Yeah.
37:30 So to like, for example, open up file dialogue, you create a context manager and you just say with, I don't remember the exact command, but you give it basically the file description.
37:39 And then the file filter and you say open and you just check to see if they hit okay versus cancel.
37:44 And then you work with it in the, within the context.
37:47 All the WX Python dialogues.
37:49 And I think maybe even the frames support using them as a context manager to open and show them.
37:54 Yeah.
37:54 It would make sense if you wanted to create the equivalent of a modal dialogue, but a custom one that you create, put that in a width block too.
38:00 Right.
38:01 Would that work?
38:01 If you inherit from Dabix dialogue, I believe it well.
38:04 Yes.
38:04 Okay.
38:05 Yeah.
38:05 Super neat.
38:06 So I guess you probably have to learn your class hierarchy.
38:09 It sounds like I got to know.
38:11 I got, I, this one derives from frame.
38:12 That one derives from dialogue.
38:14 Unfortunately, there is a bit of a learning curve.
38:17 Yes.
38:18 But once you've got the, the top level widgets figured out, which are frame dialogue and window, and you almost never use window, you know, you're not too bad.
38:26 Yeah.
38:26 All right.
38:27 Another one that you built was the database viewer based on SQLAlchemy, object list view, and so on.
38:34 And tell us about that.
38:35 So I actually wrote this example a long time ago for my blog, and then I updated it for my book.
38:40 I've always liked SQLAlchemy, and I realized that I could create a SQLAlchemy model class and use it with Dabix Python because they have a third party widget called the object list view that basically matches a model in SQLAlchemy almost exactly.
38:56 So I can kind of combine the two classes and make them work together in a way.
39:00 So that's kind of what I did.
39:02 I just made it so that I could open up a SQLite database in the book.
39:05 Do you basically see the tables and then click on them and get the records or something like that?
39:10 Yes.
39:10 You can see the records.
39:11 I think I made it so I can edit the records too, or maybe that was just on my blog that I did that.
39:17 Yeah.
39:17 What widget do you use that shows basically the Excel looking view?
39:21 That's object list view.
39:22 Dabix Python has its own native widget called WRX list control.
39:26 And object list view is kind of a wrapper of that widget that makes it a lot easier to work with, in my opinion.
39:33 Yeah.
39:33 What about animations?
39:35 I know that doesn't have anything to do with the app that we're talking about, but is there some sort of support for changing the screen?
39:42 Or if I'm going to put something on the screen, like I want to build a dashboard that is maybe looking at all the analytics on our system and it updates once a second.
39:51 How easy is that to do?
39:52 So if you're talking like a graph?
39:54 A graph or even if it just has numbers, like here's the current flow rate of such and such or the number of users on the site versus like the minutes of video watch today up to date by the second.
40:06 Something like that.
40:07 Yeah.
40:07 You have a couple of options.
40:08 Dabix widgets has a, I believe it's called a device context.
40:11 Dabix.dc.
40:13 It has a couple of different variants of that.
40:15 You can use it to basically draw whatever you want.
40:17 And it's the basis for creating a lot of the custom widgets that you'll see in the Dabix Python demo.
40:22 So you could use that to like draw any custom widgets you want.
40:25 I see.
40:26 So you're just given like a rectangle or whatever and just go crazy with the draw commands on it.
40:31 Yes.
40:32 The alternative is that Dabix Python supports matplotlib and can embed it easily.
40:37 And it also has its own pyplot library.
40:39 So it can draw them without matplotlib itself.
40:43 So both of those are also options.
40:45 Yeah.
40:45 Very nice.
40:46 What's the external like super custom control world look like?
40:51 So we've got the Wix widgets, but are there like other third party libraries that you get?
40:56 Like, oh, here's like a really fancy editable grid type of thing or auto completing drop downs or,
41:03 you know, is there an ecosystem around those types of things?
41:06 And I remember in Visual Basic and like Windows forums, there was like whole companies based around
41:11 building those little extensions.
41:13 Well, I know that I know the object list view was a third party one for a while and it still
41:18 is third party.
41:19 But I think the actual C++ version of it has outstripped the current wrapper for it.
41:26 So it's the current wrapper doesn't follow it very well anymore.
41:28 Besides that, there used to be a guy, Andrea Gavanna, I believe is his name.
41:33 He created a ton of awesome custom widgets for Dabix Python.
41:37 And eventually they got wrapped into the Python framework itself.
41:41 So now it's like import WX.agw and you have access to all of those custom widgets within
41:47 Dabix Python.
41:48 But besides those, there's not a lot out there that I can think of that are like just custom
41:55 ones you'd add on.
41:56 Right.
41:56 I was doing some quick searching for whether or not there's like an awesome list, basically,
42:01 for those types of things.
42:03 I couldn't find it, but maybe people, someone out there knows the one, they can send it
42:06 to us and I'll put it in the show notes.
42:08 Cool.
42:08 Yeah.
42:08 Cool.
42:09 So another one that you built was one that would look at basically zip files or tarball
42:15 and pull those apart.
42:16 Yeah.
42:17 What are some of the cool takeaways from that?
42:18 Oh, for me, it was fun to dig into Python's native Tarian libraries, which I haven't played
42:24 with that much.
42:25 And I was originally going to include the zip file, but zip files tended to be more buggy when
42:30 I was playing with it.
42:31 So I just stuck with tarballs to keep it simple.
42:34 But the main takeaway is that it works really well with WX Python.
42:37 I try to show newer concepts like Pathlib in this book using, you know, in conjunction with
42:43 the tar file library.
42:46 Yeah.
42:46 Pathlib is nice.
42:47 Yeah.
42:47 It's not entirely obvious when you first get to it that the division operator been taken
42:52 over.
42:52 No, it's not.
42:53 To combine elements.
42:55 But at the same time, it is quite neat once you learn it.
42:58 Yeah.
42:58 The syntax always throws me when I see those examples.
43:01 I'm like, what?
43:01 Oh, yeah.
43:03 All right.
43:03 That's how it works.
43:04 Yeah.
43:04 All same thing for date time and time deltas.
43:06 Nice.
43:07 Yes.
43:07 And then you mix those with f-strings and you get into a whole other world.
43:11 Yeah, absolutely.
43:13 Absolutely.
43:13 All right.
43:14 Another one that you discussed was creating an application for NASA's API.
43:18 I don't know what NASA's API is, but that sounds fun.
43:21 Tell us about that.
43:23 So this one was actually recommended to me by the Kickstarter people that were back to the
43:28 book.
43:28 They were like, so whenever I do a Kickstarter, I ask the backers, what ideas do you guys have?
43:33 What do you think will be a good addition?
43:35 And someone was like, well, NASA's API is basically open source.
43:40 You can query it if you have a license API key.
43:43 And you can make it show you basically any pictures that NASA has publicly available.
43:48 So the NASA API will let you get photos of the moon, get photos of their launches, get
43:54 photos of Mars, you know, whatever.
43:55 Nice.
43:56 And they really wanted an example of how do you make Dibix Python hook up to a web API?
44:01 So that's kind of what this chapter is about.
44:04 Yeah.
44:04 That's a pretty cool example, right?
44:06 There's a lot of fun stuff that you can check out there.
44:08 Yeah.
44:09 It was fun.
44:10 So at api.nasa.gov, you can go over there and yeah, there's a bunch of stuff.
44:15 Pad maps for the moons, two-line element data for earth elements orbiting the earth.
44:21 Yes.
44:22 You update it in real time and so on.
44:24 Yeah.
44:24 Nice.
44:25 So what did you end up actually building?
44:27 Like there's a bunch of APIs there.
44:29 I think this one only like loads, it has a, basically a list control widget, which I use
44:35 to display the search results when you query the NASA search.
44:39 And then when you click on them, it will load the image.
44:42 So, you know, if I looked up like Challenger space flight or Apollo or whatever, it'll show
44:47 all the public NASA images in that list box and you can click on them and it will load the
44:52 picture for you.
44:53 So you can view the picture.
44:54 Yeah.
44:54 There's a ton of room for improvement, like how to download the picture, which I believe
44:58 I covered how to download it with the GUI.
45:00 But you could also, you know, add a tag editor.
45:03 So you could view the metadata in the images.
45:06 Right.
45:06 And then you could browse it by show me all the pictures of the shuttle or, you know, things
45:11 from this mission or something like that.
45:13 Or from this date.
45:13 Yeah.
45:14 Yeah.
45:14 Cool.
45:14 That seems like a really fun thing to play with.
45:16 And just people who are looking to have a fun API out there in the world to choose.
45:20 That seems like a neat one.
45:21 Yeah, it was really neat.
45:22 Yeah.
45:23 Super cool.
45:24 So I guess, you know, there's a bunch of other stuff that we could talk about that
45:27 you wrote about.
45:28 But I think one maybe final thing, one of the challenges that's not immediately obvious with
45:34 Python is how do I take my Python code and give it to somebody so they can put it in their
45:40 doc or their taskbar as a picture and click it and see it without them, without discussing,
45:46 here's how you create a virtual environment.
45:47 Here's how you have the right version of Python.
45:49 Here's how you pip install the requirements.
45:50 How do you distribute this as what normal people would perceive as an application?
45:55 Well, fortunately, the major Python GUI builder, executable builders support WX Python.
46:02 So in the book, I use PyInstaller as an example, because it can package up WX Python pretty easily.
46:09 Okay.
46:09 You have to give it a special command line argument to tell it that it's a windowed application
46:15 versus a terminal application.
46:16 Right.
46:17 I think maybe the default is to also have a terminal window.
46:20 It would distribute it, but you have an odd terminal window just to the side of your app.
46:25 Yeah.
46:25 So if you have like any debug in your application, it'd show up in the terminal window, which,
46:29 you know, might not be ideal.
46:30 Yeah.
46:31 No, for sure.
46:32 So I cover that in the book.
46:34 The nice thing about PyInstallers, it also works for creating executables on Mac and
46:38 Windows.
46:39 Not all of them do that.
46:40 I have used Py2XE pretty extensively over the years, and it works great for Windows.
46:45 But, you know, again, it's not going to work for anything else.
46:48 Right.
46:48 So you found PyInstaller was pretty reliable across the platforms?
46:51 Yeah, it works really well.
46:53 The only problem I have is that I think if you do the all-in-one file, Windows Defender
46:59 will mark it as malicious and delete it.
47:02 Oh, that's not good.
47:03 And I think it does that for, you know, whether it's a WX Python file or not.
47:07 Anytime you create the one file executable with PyInstaller, it's like, oh, that's a bad
47:13 file.
47:13 I'm going to delete it for you.
47:14 Not ideal.
47:15 No.
47:16 I think you can...
47:16 Someone must have used it to try to package up a virus or something at one point, and
47:21 then it got fingerprinted and that was that.
47:23 Yeah.
47:24 I think you can self-sign the file or something to get around that, but I didn't go into that
47:29 in the book.
47:29 Yeah.
47:29 I think you got to register as a developer with Microsoft to get like a signing certificate
47:33 or something.
47:34 Mm-hmm.
47:34 I don't think I've ever done that.
47:36 So, but there are, like when you say try to run it, you know, same thing on Mac.
47:39 It could either, sometimes it'll completely block it.
47:42 Sometimes it'll say that came from the internet, but we kind of recognize that person.
47:46 Or I guess if you super duper sign it, it'll just run.
47:49 Yes.
47:50 Yeah.
47:50 Depending on the platform.
47:52 So another thing, you know, one thing that I did is I created this little app that runs
47:56 in the Mac menu bar, and I created that with Py2App, and then it just gives people a .app
48:02 file, well, zipped up, but then you unzip it, it's a .app file.
48:06 Yeah.
48:06 And then you can just run it, and that's worked well.
48:08 But like Py2Exe, Py2App is a Mac-only thing, right?
48:13 Like one platform.
48:14 I know Py2App also works with WXPython, my experience.
48:17 Yeah.
48:17 These sort of packaging utilities, they work pretty well for the different platforms.
48:22 If you're using .duvx Python.
48:23 Yes.
48:24 Yep.
48:24 I haven't had any problems with them.
48:26 You can get squirrely things with other packages, but not usually with WX.
48:30 Yeah.
48:30 Very cool.
48:31 All right, Mike.
48:31 Well, I think about is all the time we have to talk about GUIs and stuff, at least .duvx
48:38 Python.
48:39 But give us your verdict.
48:40 Is there something you enjoy working with, building apps that people are liking with it?
48:44 I don't know about other people, but I still use it whenever I can.
48:47 For work, I'll create simple apps to demo whatever I need to demo to my employer or my PM.
48:55 So, I mean, you can still throw together a really simple app with WX Python and only a hundred lines,
49:00 or, you know, a couple hundred lines.
49:01 And they'll show off something that looks awesome across platforms.
49:04 Yeah, very cool.
49:05 Yeah, again, I know I keep going on and on, but the native bits just make me happy.
49:09 A quick couple of questions from the live stream.
49:12 One is, it doesn't want to show up.
49:15 There you go.
49:16 If I purchase the book, WX Python recipes, is it still relevant or outdated?
49:20 I'm not familiar with this book.
49:22 Yeah.
49:22 Is this yours?
49:23 I have a WX Python cookbook from A-Press.
49:25 I believe the examples in it still work, but they're kind of like all over the place.
49:29 I tried to group them intelligently, but I mean, they're helpful, but they're not going to
49:35 like help you.
49:36 I don't know how to describe it, but they're more like, these are very specific things.
49:40 So read the table of contents before you buy that one.
49:43 If he's talking about Cody Precord's book, which is Dibbix Python recipes from Pact Publishing.
49:47 I haven't read it in a while, so I don't remember.
49:50 Yeah.
49:51 And I have no experience with it either.
49:53 So, but you can check out this one.
49:54 This has got at least 10 good little apps in it for sure.
49:57 Yeah.
49:58 Okay.
49:58 So I guess with that, I'll ask you the final two questions that I always ask everyone.
50:03 If you're going to write some Python code, what editor are you using these days?
50:06 I'm still a big fan of Wing IDE from Wingware.
50:10 Cool.
50:11 So I hear a lot of people on the VS Code wagon these days, like why Wing?
50:16 For me, I still like that it has a source, what do you call it, a source assistant, which
50:22 basically shows you the doc strings and links to the documentation live at all times for
50:27 whatever line of code you're on.
50:29 So, you know, if you've imported something, it'll show you all that stuff and basically
50:32 help you learn new modules as you work.
50:35 The other thing I really like is the debugger.
50:37 The debugger on it is really good.
50:39 Yeah.
50:39 Fantastic.
50:39 Okay.
50:40 And then notable PyPI package.
50:42 I mean, there's always WX Python if you want to throw that one out there, but you got
50:46 another one in mind.
50:47 For me, it would probably be OpenPyXL because I've been working with it a lot the last couple
50:53 of months.
50:54 So OpenPyXL basically lets you read and write Excel files, the newer format, right?
50:59 The XLSX version.
51:01 Yes, it does.
51:02 And you can do formulas and formatting and everything.
51:04 Is that right?
51:05 Am I...
51:06 Formulas are kind of iffy, but the rest of it is, it does do.
51:10 Nice.
51:10 Pretty cool.
51:11 So many people, I'm sure, receive Excel files all of the time and they want to process
51:17 it with code rather than with a mouse and keyboard.
51:20 So very nice.
51:21 Awesome.
51:21 Awesome.
51:22 All right.
51:22 Well, final call to action.
51:24 People want to get started with WX Python.
51:26 What do they do?
51:26 They can check out my book or you can just go to WXPython.org and get everything you need
51:31 right there.
51:32 Awesome.
51:32 Yeah.
51:32 And I'll put a link to that in the show notes.
51:34 So thanks everyone for listening.
51:36 And Mike, thanks for all you're doing around the GUI stuff.
51:39 Thank you so much for having me.
51:41 You bet.
51:41 Bye.
51:41 Bye.
51:42 This has been another episode of Talk Python to Me.
51:46 Our guest on this episode was Mike Driscoll.
51:48 And it's been brought to you by Linode, us over at Talk Python Training, and the transcripts
51:53 are brought to you by Assembly AI.
51:54 Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.
52:00 Develop, deploy, and scale your modern applications faster and easier.
52:03 Visit talkpython.fm/Linode and click the create free account button to get started.
52:09 Transcripts for this and all of our episodes are brought to you by Assembly AI.
52:12 Do you need a great automatic speech-to-text API?
52:15 Get human-level accuracy in just a few lines of code.
52:18 Visit talkpython.fm/Assembly AI.
52:21 Want to level up your Python?
52:22 We have one of the largest catalogs of Python video courses over at Talk Python.
52:26 Our content ranges from true beginners to deeply advanced topics like memory and async.
52:32 And best of all, there's not a subscription in sight.
52:34 Check it out for yourself at training.talkpython.fm.
52:38 Be sure to subscribe to the show, open your favorite podcast app, and search for Python.
52:42 We should be right at the top.
52:43 You can also find the iTunes feed at /itunes, the Google Play feed at /play,
52:48 and the direct RSS feed at /rss on talkpython.fm.
52:53 We're live streaming most of our recordings these days.
52:56 If you want to be part of the show and have your comments featured on the air,
52:59 be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
53:04 This is your host, Michael Kennedy.
53:06 Thanks so much for listening.
53:07 I really appreciate it.
53:08 Now get out there and write some Python code.
53:10 I'll see you next time.