WEBVTT

1
00:00:00.120 --> 00:00:03.240
<v Speaker 1>Welcome to the deep dive. You know how this works. Yeah,

2
00:00:03.279 --> 00:00:05.919
<v Speaker 1>you send us your stuff, your sources, and we well,

3
00:00:06.120 --> 00:00:08.960
<v Speaker 1>we dive deep to pull out the really important bits.

4
00:00:09.320 --> 00:00:11.480
<v Speaker 2>Exactly. The goal is to get you up to speed

5
00:00:11.599 --> 00:00:14.279
<v Speaker 2>quickly without you having to weigh through everything yourself.

6
00:00:14.800 --> 00:00:17.399
<v Speaker 1>So today, based on what you sent over, we're looking

7
00:00:17.440 --> 00:00:22.640
<v Speaker 1>at these excerpts from twisted Python projects. Specifically, the first

8
00:00:22.640 --> 00:00:26.920
<v Speaker 1>few chapters all about building gui's graphical user interfaces.

9
00:00:27.039 --> 00:00:30.079
<v Speaker 2>That's right, using Python and a library called guy zero.

10
00:00:30.359 --> 00:00:31.920
<v Speaker 1>Looks like you're aiming to figure out how to make

11
00:00:31.960 --> 00:00:35.000
<v Speaker 1>Python apps you can actually you click on and interact with.

12
00:00:35.119 --> 00:00:37.840
<v Speaker 2>And these early chapters seem like a really practical starting point.

13
00:00:38.079 --> 00:00:40.119
<v Speaker 2>We'll look at how guy zero is supposed to make

14
00:00:40.159 --> 00:00:42.840
<v Speaker 2>things easier, starting with a basic Hello Gui.

15
00:00:43.079 --> 00:00:47.200
<v Speaker 1>Right. Then there's a joke Machine project and something called

16
00:00:47.240 --> 00:00:48.960
<v Speaker 1>a fart box soundboard.

17
00:00:49.039 --> 00:00:52.200
<v Speaker 2>Okay, yes that one's quite something, but they all teach

18
00:00:52.280 --> 00:00:53.200
<v Speaker 2>useful concepts.

19
00:00:53.399 --> 00:00:57.280
<v Speaker 1>I saw the subtitle twelve wacky, useful, tricky, cool fun

20
00:00:57.359 --> 00:01:00.399
<v Speaker 1>things to do That definitely taught my eye. Yes, we're

21
00:01:00.439 --> 00:01:02.759
<v Speaker 1>not just like learning syntax rules.

22
00:01:02.759 --> 00:01:06.040
<v Speaker 2>No, definitely not. It's about building tangible things, which is

23
00:01:06.040 --> 00:01:08.359
<v Speaker 2>often a much more engaging way to learn coding, right,

24
00:01:08.719 --> 00:01:09.799
<v Speaker 2>helps the ideas stick.

25
00:01:09.959 --> 00:01:14.000
<v Speaker 1>Okay, let's jump in chapter one. Low, gy, what are

26
00:01:14.000 --> 00:01:18.120
<v Speaker 1>the aims here? Looks like understanding Python. GUIs getting set

27
00:01:18.200 --> 00:01:18.560
<v Speaker 1>up and.

28
00:01:18.519 --> 00:01:20.560
<v Speaker 2>Building that very first interactive window.

29
00:01:20.640 --> 00:01:24.519
<v Speaker 1>Yeah, now, Python, Well it's everywhere, isn't it. The book

30
00:01:25.159 --> 00:01:29.280
<v Speaker 1>calls it one of the fastest growing programming languages, superversal.

31
00:01:28.640 --> 00:01:33.239
<v Speaker 2>Absolutely, websites, games, automation. Yeah, you can do a lot

32
00:01:33.239 --> 00:01:35.640
<v Speaker 2>with it, and it's generally seen as easier to read

33
00:01:35.680 --> 00:01:37.120
<v Speaker 2>than some other languages.

34
00:01:36.760 --> 00:01:39.879
<v Speaker 1>Which probably helps explain his popularity. And the name I

35
00:01:39.920 --> 00:01:40.480
<v Speaker 1>saw that mention.

36
00:01:40.519 --> 00:01:43.760
<v Speaker 2>Oh yeah, the Monty Python connection. Gredovin Rossum. The creator

37
00:01:43.879 --> 00:01:44.680
<v Speaker 2>was apparently a fan.

38
00:01:44.760 --> 00:01:47.480
<v Speaker 1>He just wanted something short and memorable. It's kind of

39
00:01:47.480 --> 00:01:48.840
<v Speaker 1>funny for such a powerful tool.

40
00:01:49.000 --> 00:01:51.879
<v Speaker 2>It is shows you don't always need a super serious name.

41
00:01:52.120 --> 00:01:55.319
<v Speaker 2>And the book highlights Python's simplicity early on, right with.

42
00:01:55.280 --> 00:01:58.840
<v Speaker 1>The Hillo World example. Just print Hello World simple.

43
00:01:58.519 --> 00:02:00.319
<v Speaker 2>Compared to some other languages. The need Moore set up

44
00:02:00.359 --> 00:02:00.959
<v Speaker 2>lines just for that.

45
00:02:01.079 --> 00:02:01.359
<v Speaker 1>Yeah.

46
00:02:01.519 --> 00:02:04.879
<v Speaker 2>The idea is fewer lines can mean fewer places for errors.

47
00:02:05.200 --> 00:02:09.360
<v Speaker 1>Okay, so that's Python, but we're building Jui's Guy's Hey.

48
00:02:09.560 --> 00:02:12.599
<v Speaker 2>Yeah, the book uses that Cadbury's cream eg analogy.

49
00:02:12.680 --> 00:02:15.159
<v Speaker 1>It does a visual way to interact. Yeah, and so

50
00:02:15.360 --> 00:02:16.960
<v Speaker 1>just typing commands exactly.

51
00:02:17.000 --> 00:02:21.240
<v Speaker 2>Think about your smartphone ATMs, anything with buttons and icons

52
00:02:21.240 --> 00:02:24.120
<v Speaker 2>on a screen, that's a GUI. It's usually much more

53
00:02:24.159 --> 00:02:25.360
<v Speaker 2>intuitive for most people.

54
00:02:25.479 --> 00:02:27.479
<v Speaker 1>Makes sense. And the tool for this in the book is.

55
00:02:27.479 --> 00:02:31.039
<v Speaker 2>GOO zero right, created by Laura Sak and Martin O'Hanlon.

56
00:02:31.520 --> 00:02:34.439
<v Speaker 2>The book says it's specifically designed as a simpler way

57
00:02:34.520 --> 00:02:37.759
<v Speaker 2>to make UIs in Python three, especially for learners.

58
00:02:38.000 --> 00:02:41.039
<v Speaker 1>So it's a library like a collection of pre written code.

59
00:02:41.080 --> 00:02:44.919
<v Speaker 2>Precisely. It gives you building blocks, buttons, textboxes, so you

60
00:02:44.960 --> 00:02:47.319
<v Speaker 2>don't have to code them from scratch every single time.

61
00:02:47.639 --> 00:02:48.599
<v Speaker 2>Saves a lot of effort.

62
00:02:48.639 --> 00:02:51.280
<v Speaker 1>And the book mentions an easy install option too, just

63
00:02:51.400 --> 00:02:52.319
<v Speaker 1>downloading files.

64
00:02:52.400 --> 00:02:54.159
<v Speaker 2>Yeah, that can be useful if you're on a computer

65
00:02:54.240 --> 00:02:57.560
<v Speaker 2>where you maybe can install software normally, But the standard way.

66
00:02:57.560 --> 00:03:00.319
<v Speaker 1>Is using the command prompt right with PIP three exactly.

67
00:03:00.360 --> 00:03:04.800
<v Speaker 2>PIP three installed zero. KIP is Python's package installer. Think

68
00:03:04.800 --> 00:03:07.360
<v Speaker 2>of it like an app store for Python code libraries.

69
00:03:07.400 --> 00:03:09.360
<v Speaker 2>It fetches GU zero and sets it up for you.

70
00:03:09.680 --> 00:03:14.039
<v Speaker 1>Okay, and once it's installed, GO zero has elements and widgets.

71
00:03:14.319 --> 00:03:17.240
<v Speaker 2>Yeah, that's how the book categorizes things. Widgets are the

72
00:03:17.319 --> 00:03:21.319
<v Speaker 2>visible things you interact with. Buttons, text, inputs, labels. Elements

73
00:03:21.360 --> 00:03:26.080
<v Speaker 2>are more about structure and behavior like layout or handling events.

74
00:03:26.199 --> 00:03:28.919
<v Speaker 1>Gotcha. Now to write the code, you need an id.

75
00:03:29.240 --> 00:03:33.159
<v Speaker 2>An integrated development environment. Yeah. It's basically a specialized text

76
00:03:33.280 --> 00:03:34.759
<v Speaker 2>editor for code.

77
00:03:34.400 --> 00:03:38.159
<v Speaker 1>And Python comes a one called IDL E pronounced idle.

78
00:03:38.599 --> 00:03:40.919
<v Speaker 2>That's the one it's built in, so it's convenient to

79
00:03:40.919 --> 00:03:43.479
<v Speaker 2>get started with. The book focuses on using IDL E,

80
00:03:43.680 --> 00:03:43.960
<v Speaker 2>and it.

81
00:03:43.919 --> 00:03:49.039
<v Speaker 1>Stresses organizing your code into sections, imports, variables, functions, app.

82
00:03:48.919 --> 00:03:51.120
<v Speaker 2>Which is really good practice. It makes your code much

83
00:03:51.120 --> 00:03:54.439
<v Speaker 2>easier to read, understand, and importantly debug later on.

84
00:03:54.599 --> 00:03:58.199
<v Speaker 1>Okay, let's walk through that first project. Hello Gui. It's

85
00:03:58.240 --> 00:04:00.759
<v Speaker 1>like Hello World, but interact right.

86
00:04:00.840 --> 00:04:02.759
<v Speaker 2>Instead of just printing text, you get a window. You

87
00:04:02.800 --> 00:04:04.759
<v Speaker 2>type your name in a box, click a button, and a.

88
00:04:04.680 --> 00:04:07.280
<v Speaker 1>Pop up says hello plus your name exactly.

89
00:04:07.560 --> 00:04:10.479
<v Speaker 2>It introduces input, the user typing their name and output

90
00:04:10.560 --> 00:04:12.879
<v Speaker 2>the pop up message. Very fundamental concepts.

91
00:04:13.199 --> 00:04:17.160
<v Speaker 1>First step, the book emphasizes save the file like Hello Gui,

92
00:04:17.240 --> 00:04:17.839
<v Speaker 1>dot poy.

93
00:04:17.800 --> 00:04:20.519
<v Speaker 2>Always save early, save often good advice.

94
00:04:20.800 --> 00:04:24.079
<v Speaker 1>Then the import section we need app for the main window,

95
00:04:24.560 --> 00:04:27.399
<v Speaker 1>info for the pop up message. Yet that's specific type

96
00:04:27.439 --> 00:04:30.199
<v Speaker 1>of pop up, push button for the button, textbox for typing,

97
00:04:30.279 --> 00:04:31.800
<v Speaker 1>and text for labels.

98
00:04:31.639 --> 00:04:35.160
<v Speaker 2>And you import them from Guizero. You're telling Python, I

99
00:04:35.240 --> 00:04:37.959
<v Speaker 2>need these specific tools from the Gui zero toolkit.

100
00:04:38.160 --> 00:04:42.439
<v Speaker 1>The book also explains comments lines starting with hashtag ignored

101
00:04:42.480 --> 00:04:45.199
<v Speaker 1>by Python but helpful for humans reading the.

102
00:04:45.160 --> 00:04:48.720
<v Speaker 2>Code, essential for documentation and explaining complex parts.

103
00:04:48.800 --> 00:04:52.720
<v Speaker 1>Then variables. The book uses that labeled jars analogy for

104
00:04:52.839 --> 00:04:54.160
<v Speaker 1>storing data in memory.

105
00:04:54.240 --> 00:04:57.319
<v Speaker 2>It's a good analogy. While this first project isn't heavy

106
00:04:57.360 --> 00:05:00.800
<v Speaker 2>on variables, the concept is crucial for almost any program,

107
00:05:00.920 --> 00:05:02.920
<v Speaker 2>so introducing it early makes sense.

108
00:05:03.079 --> 00:05:06.639
<v Speaker 1>Next, functions many programs for specific tasks.

109
00:05:06.800 --> 00:05:09.600
<v Speaker 2>Right, you define them once using def like deaf hello,

110
00:05:10.040 --> 00:05:12.360
<v Speaker 2>and then you can call that function whenever you need it.

111
00:05:12.680 --> 00:05:14.959
<v Speaker 1>The book uses a game over sequence as an example.

112
00:05:15.079 --> 00:05:18.800
<v Speaker 1>Right at once, call it multiple times saves repeating code.

113
00:05:18.519 --> 00:05:22.480
<v Speaker 2>Exactly in this project. The Hello function contains the code

114
00:05:22.480 --> 00:05:24.439
<v Speaker 2>to create that pop up message.

115
00:05:24.480 --> 00:05:28.839
<v Speaker 1>He uses info and joins Hello with whatever's in the textbox.

116
00:05:29.240 --> 00:05:30.680
<v Speaker 1>String concatenation yep.

117
00:05:30.800 --> 00:05:32.920
<v Speaker 2>Just stick in pieces of text together, and.

118
00:05:33.000 --> 00:05:36.560
<v Speaker 1>The book mentions syntax here. The grammar of code using

119
00:05:36.560 --> 00:05:40.360
<v Speaker 1>that Thor's hammer example. Yeah, spelling and structure matter.

120
00:05:40.319 --> 00:05:44.000
<v Speaker 2>They absolutely do. A misplaced comma or a typo can

121
00:05:44.000 --> 00:05:45.639
<v Speaker 2>stop the whole thing from working.

122
00:05:45.920 --> 00:05:49.360
<v Speaker 1>Okay. Finally, the hashtag app section building the actual GUI.

123
00:05:49.560 --> 00:05:51.000
<v Speaker 2>This is where you put the pieces together.

124
00:05:51.160 --> 00:05:54.800
<v Speaker 1>App app Hello World creates the window and.

125
00:05:54.759 --> 00:05:56.720
<v Speaker 2>Sets the title app is the main container.

126
00:05:56.800 --> 00:05:59.759
<v Speaker 1>Then added text widget for instructions and to your name

127
00:06:00.120 --> 00:06:02.800
<v Speaker 1>the static label. Then the textbox widget for the user

128
00:06:02.800 --> 00:06:03.279
<v Speaker 1>to type in.

129
00:06:03.360 --> 00:06:05.720
<v Speaker 2>You can set the width right control the size.

130
00:06:05.519 --> 00:06:07.759
<v Speaker 1>You push button. This is key command Hello links the

131
00:06:07.800 --> 00:06:09.360
<v Speaker 1>button click to our hello function.

132
00:06:09.560 --> 00:06:14.160
<v Speaker 2>That's the connection event. Button click triggers the function show.

133
00:06:13.879 --> 00:06:16.000
<v Speaker 1>Pop up, and you set the buttons label like click

134
00:06:16.079 --> 00:06:20.560
<v Speaker 1>me yep. And the most important line maybe app dot.

135
00:06:20.360 --> 00:06:23.839
<v Speaker 2>Display absolutely critical. Without that, you define the GUI, but

136
00:06:23.920 --> 00:06:25.519
<v Speaker 2>it never actually shows up on the screen.

137
00:06:25.639 --> 00:06:28.199
<v Speaker 1>Then you run it usually F five and IDL E.

138
00:06:28.720 --> 00:06:30.480
<v Speaker 1>The book also lists common.

139
00:06:30.279 --> 00:06:35.199
<v Speaker 2>Errors to check installation issues, typos, case sensitivity, the usual

140
00:06:35.240 --> 00:06:36.720
<v Speaker 2>suspects when you're starting out.

141
00:06:36.560 --> 00:06:38.160
<v Speaker 1>And I like that. Three other things to try A

142
00:06:38.199 --> 00:06:42.199
<v Speaker 1>bit change background color with big, resize the textbox, use

143
00:06:42.240 --> 00:06:43.879
<v Speaker 1>a worn pop up instead of info.

144
00:06:44.120 --> 00:06:47.879
<v Speaker 2>Encourages experimentation right away, reinforces learning by doing.

145
00:06:48.120 --> 00:06:53.240
<v Speaker 1>Yeah, and the recap of terms zero, widgets, functions, useful summary.

146
00:06:53.000 --> 00:06:55.199
<v Speaker 2>Definitely helps solidify those core ideas.

147
00:06:55.399 --> 00:06:59.639
<v Speaker 1>Okay, moving on chapter two, Are you funnier than a hyena?

148
00:07:00.519 --> 00:07:01.639
<v Speaker 1>The choke machine? Hey?

149
00:07:01.759 --> 00:07:05.079
<v Speaker 2>Yes, a gooi with a button that shows a random joke.

150
00:07:05.439 --> 00:07:07.480
<v Speaker 2>Simple idea but introduces new things.

151
00:07:07.600 --> 00:07:10.439
<v Speaker 1>The book mentions the benefits of laughter. First, nice touch,

152
00:07:10.600 --> 00:07:11.199
<v Speaker 1>that's the mood.

153
00:07:11.399 --> 00:07:14.399
<v Speaker 2>And this project teaches about using Python's random module and

154
00:07:14.480 --> 00:07:15.399
<v Speaker 2>working with lists.

155
00:07:15.519 --> 00:07:18.879
<v Speaker 1>So imports. First, we need app text push button from

156
00:07:18.879 --> 00:07:19.560
<v Speaker 1>guy zero.

157
00:07:19.399 --> 00:07:21.439
<v Speaker 2>Against standard Gooi elements.

158
00:07:21.000 --> 00:07:23.639
<v Speaker 1>But also import random that's built into Python itself.

159
00:07:23.720 --> 00:07:26.959
<v Speaker 2>Right, Yes, random is part of Python's standard library. Very

160
00:07:27.040 --> 00:07:27.759
<v Speaker 2>useful module.

161
00:07:28.040 --> 00:07:32.800
<v Speaker 1>Then we need jokes. The book explains lists storing multiple

162
00:07:32.839 --> 00:07:35.319
<v Speaker 1>items in one variable like a shopping list.

163
00:07:35.519 --> 00:07:39.000
<v Speaker 2>Good analogy. Here we create list of jokes and put

164
00:07:39.120 --> 00:07:42.439
<v Speaker 2>joke strings inside parentheses separated by commas.

165
00:07:42.639 --> 00:07:46.160
<v Speaker 1>Right, and use underscores in the variable name list of jokes, not.

166
00:07:46.240 --> 00:07:49.000
<v Speaker 2>Spaces common Python style makes it readable.

167
00:07:49.079 --> 00:07:52.480
<v Speaker 1>The book suggests using print to check the list first,

168
00:07:52.480 --> 00:07:54.600
<v Speaker 1>then commenting it out smart debugging.

169
00:07:54.959 --> 00:07:57.519
<v Speaker 2>Yeah, print debugging is simple but effective. Check the data

170
00:07:57.519 --> 00:07:58.720
<v Speaker 2>looks right before you use it.

171
00:07:58.800 --> 00:08:02.920
<v Speaker 1>Okay. The core logic the select joke function. How does

172
00:08:02.959 --> 00:08:03.879
<v Speaker 1>it pick a random one?

173
00:08:03.920 --> 00:08:07.079
<v Speaker 2>It uses random dot rand range. This function needs a

174
00:08:07.160 --> 00:08:08.759
<v Speaker 2>range of numbers to pick from, and that.

175
00:08:08.800 --> 00:08:11.240
<v Speaker 1>Range relates to the position of jokes in the list.

176
00:08:11.399 --> 00:08:13.560
<v Speaker 1>Python lists start at index zero.

177
00:08:13.399 --> 00:08:16.040
<v Speaker 2>Right exactly, first joke is at zero, second, one, and

178
00:08:16.079 --> 00:08:17.959
<v Speaker 2>so on. So if you have four jokes, the indices

179
00:08:18.000 --> 00:08:19.120
<v Speaker 2>are zero, one, two, three.

180
00:08:19.199 --> 00:08:20.839
<v Speaker 1>But we don't want to hardcode the upper number of

181
00:08:20.839 --> 00:08:22.439
<v Speaker 1>the range in case we add more chokes.

182
00:08:22.519 --> 00:08:25.199
<v Speaker 2>Right, That's where lin list of jokes comes in. Lynn

183
00:08:25.279 --> 00:08:28.240
<v Speaker 2>gives you the number of items in the list. Ah,

184
00:08:28.319 --> 00:08:31.120
<v Speaker 2>So random dot rand range Lin list of jokes. We'll

185
00:08:31.160 --> 00:08:35.159
<v Speaker 2>always pick a valid random index from zero up up

186
00:08:35.159 --> 00:08:37.639
<v Speaker 2>to but not including the link precisely.

187
00:08:37.679 --> 00:08:40.200
<v Speaker 1>It adapts automatically. If you change the number of jokes

188
00:08:40.519 --> 00:08:41.200
<v Speaker 1>very flexible.

189
00:08:41.399 --> 00:08:43.679
<v Speaker 2>Then you use that random index to get the actual

190
00:08:43.759 --> 00:08:45.480
<v Speaker 2>joke string from the list.

191
00:08:45.559 --> 00:08:47.559
<v Speaker 1>Yep like list of jokes random.

192
00:08:47.240 --> 00:08:49.720
<v Speaker 2>Index, and how do we display it? The book mentions

193
00:08:49.720 --> 00:08:52.399
<v Speaker 2>a text widget and its dot value attribute.

194
00:08:52.480 --> 00:08:55.480
<v Speaker 1>That's right. You create a text widget, maybe initially empty,

195
00:08:55.799 --> 00:08:58.519
<v Speaker 1>and then inside the function you set it's that value

196
00:08:58.519 --> 00:09:01.080
<v Speaker 1>to the chosen joke string. That updates what's shown on

197
00:09:01.120 --> 00:09:01.440
<v Speaker 1>the screen.

198
00:09:01.559 --> 00:09:04.679
<v Speaker 2>Okay, building the GUI itself, set the app title joke

199
00:09:04.759 --> 00:09:06.679
<v Speaker 2>machine maybe set with in height.

200
00:09:06.600 --> 00:09:08.679
<v Speaker 1>Standard set up with app. You can also set the

201
00:09:08.679 --> 00:09:11.240
<v Speaker 1>background color using app dot BG, add a.

202
00:09:11.200 --> 00:09:14.360
<v Speaker 2>Title text maybe using a specific font like impact.

203
00:09:14.000 --> 00:09:16.759
<v Speaker 1>Yeah text widget. Again, customizing text size and font adds

204
00:09:16.799 --> 00:09:17.759
<v Speaker 1>a bit of personality.

205
00:09:17.919 --> 00:09:20.919
<v Speaker 2>And the button push button link to select joke using

206
00:09:20.960 --> 00:09:24.039
<v Speaker 2>command select joke button text tell me a joke.

207
00:09:24.320 --> 00:09:27.039
<v Speaker 1>Just like the hellogi button, but triggering the joke function

208
00:09:27.120 --> 00:09:27.559
<v Speaker 1>this time.

209
00:09:27.720 --> 00:09:29.840
<v Speaker 2>And we need that empty text widget where the joke

210
00:09:29.840 --> 00:09:32.840
<v Speaker 2>will appear yep, a placeholder that gets updated by.

211
00:09:32.720 --> 00:09:35.080
<v Speaker 1>The function, and app dot display to show it all.

212
00:09:35.200 --> 00:09:35.879
<v Speaker 2>Can't forget that.

213
00:09:35.879 --> 00:09:38.639
<v Speaker 1>The book also shows how to make it automatic jokemachine

214
00:09:38.639 --> 00:09:40.039
<v Speaker 1>auto dot pi yeah.

215
00:09:40.200 --> 00:09:43.399
<v Speaker 2>Using the repeat method, you can tell a widget like

216
00:09:43.440 --> 00:09:46.559
<v Speaker 2>the joke display text to repeatedly call a function after

217
00:09:46.600 --> 00:09:47.720
<v Speaker 2>a certain time interval.

218
00:09:47.840 --> 00:09:51.279
<v Speaker 1>And that interval is in milliseconds.

219
00:09:50.600 --> 00:09:53.279
<v Speaker 2>Correct, so you need to convert seconds or minutes to

220
00:09:53.320 --> 00:09:55.240
<v Speaker 2>milliseconds seconds times one thousand.

221
00:09:55.519 --> 00:09:57.320
<v Speaker 1>Cool, so you could have a joke pop up every

222
00:09:57.360 --> 00:09:57.759
<v Speaker 1>minute or.

223
00:09:57.759 --> 00:09:59.960
<v Speaker 2>Something exactly a bit of scheduled fun.

224
00:10:00.080 --> 00:10:03.440
<v Speaker 1>Again. Things to try, shange font, colors, background, add a

225
00:10:03.480 --> 00:10:05.559
<v Speaker 1>funny picture with the picture widget.

226
00:10:05.320 --> 00:10:08.120
<v Speaker 2>More encouragement to tinker and learn by modifying and.

227
00:10:08.080 --> 00:10:12.759
<v Speaker 1>A recap, variable list, iteration, building blocks.

228
00:10:12.600 --> 00:10:15.399
<v Speaker 2>Slowly adding more tools to your programming toolbox.

229
00:10:15.519 --> 00:10:20.919
<v Speaker 1>I Prepare Yourself. Chapter three fart Box a disgusting soundboard.

230
00:10:21.039 --> 00:10:24.279
<v Speaker 2>Yes, memorable if nothing else. The goal is a GUI

231
00:10:24.320 --> 00:10:25.559
<v Speaker 2>with buttons that play.

232
00:10:25.440 --> 00:10:29.279
<v Speaker 1>Sounds, specifically fart sounds. Okay, yeah, But the skills learn

233
00:10:29.360 --> 00:10:35.159
<v Speaker 1>seem useful layouts buttons triggering sounds, audio playback functions, file

234
00:10:35.240 --> 00:10:37.639
<v Speaker 1>handling images exactly.

235
00:10:37.519 --> 00:10:41.519
<v Speaker 2>Beneath the surface humor, there are solid programming concepts here.

236
00:10:41.879 --> 00:10:45.000
<v Speaker 2>Layouts are particularly important for more complex interfaces.

237
00:10:45.120 --> 00:10:48.720
<v Speaker 1>So first you need sound files dot waveformat and an

238
00:10:48.720 --> 00:10:51.720
<v Speaker 1>image PNG or dot gift.

239
00:10:51.519 --> 00:10:56.000
<v Speaker 2>Right, and the book stresses organization. Create a subfolder maybe

240
00:10:56.080 --> 00:10:58.279
<v Speaker 2>called farts for these media.

241
00:10:58.000 --> 00:11:02.279
<v Speaker 1>Files, and save the pythons grit, fartmachine, dot PUI in

242
00:11:02.360 --> 00:11:04.679
<v Speaker 1>the main folder outside the farts folder.

243
00:11:04.759 --> 00:11:07.320
<v Speaker 2>Good structure keeps codes separate from assets.

244
00:11:07.480 --> 00:11:10.960
<v Speaker 1>Imports app box, picture, push button text from new zero

245
00:11:11.320 --> 00:11:14.759
<v Speaker 1>familiar stuff yep, but also import wind sound. That's for

246
00:11:14.799 --> 00:11:16.080
<v Speaker 1>playing sounds on Windows.

247
00:11:16.080 --> 00:11:19.399
<v Speaker 2>Correct, it's a Windows specific module. The book notes simple

248
00:11:19.399 --> 00:11:21.840
<v Speaker 2>idio as an alternative for Mac and Linux users.

249
00:11:21.919 --> 00:11:25.480
<v Speaker 1>Important distinction cross platform compatibility.

250
00:11:24.840 --> 00:11:27.120
<v Speaker 2>Definitely something to be aware of when dealing with things

251
00:11:27.159 --> 00:11:28.840
<v Speaker 2>like audio or system features.

252
00:11:28.919 --> 00:11:31.120
<v Speaker 1>Now the functions one for each sound dot fart one

253
00:11:31.240 --> 00:11:32.639
<v Speaker 1>to fart six makes sense.

254
00:11:32.679 --> 00:11:36.000
<v Speaker 2>Each function's job is simple play one specific sound file.

255
00:11:36.000 --> 00:11:38.960
<v Speaker 1>Using winsound dot playsound. It needs the path to the

256
00:11:38.960 --> 00:11:41.639
<v Speaker 1>sound file like fartsfart one, dot wave and that windsound

257
00:11:41.679 --> 00:11:42.440
<v Speaker 1>dot s and s y.

258
00:11:42.519 --> 00:11:46.879
<v Speaker 2>And C flag right snds CIC means a synchronous play

259
00:11:46.919 --> 00:11:49.120
<v Speaker 2>the sound, but don't make the program wait for it

260
00:11:49.159 --> 00:11:52.919
<v Speaker 2>to finish. The guy stays responsive, crucial for.

261
00:11:52.919 --> 00:11:56.440
<v Speaker 1>A soundboard where you might click buttons rapidly exactly. There's

262
00:11:56.480 --> 00:11:59.919
<v Speaker 1>also an exit function plays a burp dot wave, apparent

263
00:12:00.159 --> 00:12:03.080
<v Speaker 1>it a final flourish, and then uses app dot destroyed

264
00:12:03.159 --> 00:12:03.960
<v Speaker 1>to close the window.

265
00:12:04.200 --> 00:12:07.080
<v Speaker 2>App dot destroy is the command to properly shut down

266
00:12:07.120 --> 00:12:08.320
<v Speaker 2>the good zero application.

267
00:12:08.480 --> 00:12:13.279
<v Speaker 1>Okay, GUI build time app fart box set with height

268
00:12:13.679 --> 00:12:14.879
<v Speaker 1>background saddle brown.

269
00:12:15.480 --> 00:12:17.679
<v Speaker 2>Oh my thematic consistency perhaps?

270
00:12:17.759 --> 00:12:20.240
<v Speaker 1>Uh huh? Add a title text, add a picture widget

271
00:12:20.240 --> 00:12:22.120
<v Speaker 1>for the image. So we're adding visuals.

272
00:12:21.759 --> 00:12:25.399
<v Speaker 2>Too, Yes, showing how to integrate images alongside other widgets.

273
00:12:25.480 --> 00:12:29.279
<v Speaker 1>Now layout this uses the box object like an invisible container.

274
00:12:29.320 --> 00:12:31.080
<v Speaker 2>That's a great way to think of it. It helps

275
00:12:31.120 --> 00:12:33.320
<v Speaker 2>group and arrange other widgets.

276
00:12:32.840 --> 00:12:35.200
<v Speaker 1>And here it uses layout grid so we can place

277
00:12:35.200 --> 00:12:36.200
<v Speaker 1>buttons in rows.

278
00:12:35.960 --> 00:12:39.120
<v Speaker 2>And columns exactly like coordinates on a map or sells

279
00:12:39.120 --> 00:12:41.720
<v Speaker 2>in a spreadsheet. The book uses grid x y, where

280
00:12:41.840 --> 00:12:43.879
<v Speaker 2>x is the column and why is the row. Remember

281
00:12:44.080 --> 00:12:45.960
<v Speaker 2>zero based again, so grid.

282
00:12:45.799 --> 00:12:48.240
<v Speaker 1>Zero zero is the top left position in the box.

283
00:12:48.679 --> 00:12:52.039
<v Speaker 1>Then we create the push button widgets inside this box.

284
00:12:51.840 --> 00:12:54.759
<v Speaker 2>Yes, specifying the box as their parent container.

285
00:12:55.080 --> 00:12:57.759
<v Speaker 1>Each button gets linked to its fart function via command

286
00:12:58.039 --> 00:13:02.919
<v Speaker 1>gets button text fart one and its position. Using grid exit.

287
00:13:03.440 --> 00:13:06.600
<v Speaker 2>You carefully place each button in the desired grid sell

288
00:13:06.799 --> 00:13:07.279
<v Speaker 2>same for.

289
00:13:07.240 --> 00:13:10.720
<v Speaker 1>The exit button linked to exit text exit placed in

290
00:13:10.759 --> 00:13:14.200
<v Speaker 1>the grid and maybe colored red using dot pg.

291
00:13:14.639 --> 00:13:17.840
<v Speaker 2>Visual q that it does something different like closing the app.

292
00:13:17.799 --> 00:13:20.240
<v Speaker 1>And finally dot app dot display.

293
00:13:19.879 --> 00:13:21.200
<v Speaker 2>Bring the box to life.

294
00:13:21.240 --> 00:13:26.080
<v Speaker 1>The book includes troubleshooting again audio settings, file formats, folder structure,

295
00:13:26.320 --> 00:13:29.399
<v Speaker 1>function names, matching commands, typos, all the.

296
00:13:29.360 --> 00:13:32.759
<v Speaker 2>Common pitfalls, especially when dealing with external files and specific

297
00:13:32.840 --> 00:13:34.320
<v Speaker 2>function names and things.

298
00:13:34.120 --> 00:13:38.480
<v Speaker 1>To try change individual button colors, add more buttons and sounds.

299
00:13:38.159 --> 00:13:41.679
<v Speaker 2>Which means creating more functions, more push buttons, figuring out

300
00:13:41.759 --> 00:13:45.360
<v Speaker 2>new grid coordinates, maybe resizing the box good practice, and

301
00:13:45.440 --> 00:13:46.080
<v Speaker 2>scaling up.

302
00:13:46.240 --> 00:13:49.399
<v Speaker 1>The chapter ends with statements of fact summarizing GUI zero

303
00:13:49.600 --> 00:13:51.879
<v Speaker 1>concepts like box, grid picture.

304
00:13:52.159 --> 00:13:55.320
<v Speaker 2>Nice little recap reinforces the terminology from this chapter and

305
00:13:55.360 --> 00:13:55.919
<v Speaker 2>it gives.

306
00:13:55.679 --> 00:13:59.240
<v Speaker 1>The install command and basic usage for simple audio two

307
00:14:00.080 --> 00:14:00.840
<v Speaker 1>Windows users.

308
00:14:00.960 --> 00:14:03.519
<v Speaker 2>Good on them for including that explicitly makes the project

309
00:14:03.600 --> 00:14:04.320
<v Speaker 2>more accessible.

310
00:14:04.440 --> 00:14:07.519
<v Speaker 1>So wow, Okay, that covers the first three chapters. We

311
00:14:07.559 --> 00:14:11.000
<v Speaker 1>looked at. Quite a journey from a simple pop up

312
00:14:11.320 --> 00:14:12.879
<v Speaker 1>to a multi button soundboard.

313
00:14:12.919 --> 00:14:15.879
<v Speaker 2>It really is, and based on these excerpts, you should

314
00:14:15.919 --> 00:14:19.840
<v Speaker 2>have a well a foundational grasp of making gewiyes with

315
00:14:19.919 --> 00:14:21.559
<v Speaker 2>Python and guzero.

316
00:14:21.240 --> 00:14:24.639
<v Speaker 1>From Hello World with a button to random jokes to

317
00:14:25.679 --> 00:14:27.159
<v Speaker 1>well the fart box.

318
00:14:27.480 --> 00:14:29.440
<v Speaker 2>And even if the examples are a bit quirky, the

319
00:14:29.559 --> 00:14:35.120
<v Speaker 2>underlying principles widgets, events, functions, layouts using libraries are really

320
00:14:35.159 --> 00:14:36.519
<v Speaker 2>core programming ideas.

321
00:14:36.600 --> 00:14:39.720
<v Speaker 1>Yeah, you've gotten from basic syntax to building things that

322
00:14:39.759 --> 00:14:42.759
<v Speaker 1>actually do stuff on screen, respond to clicks, play sounds.

323
00:14:42.799 --> 00:14:44.759
<v Speaker 2>It's a tangible way to see your code come to life,

324
00:14:44.799 --> 00:14:46.480
<v Speaker 2>which can be really motivating.

325
00:14:46.120 --> 00:14:48.679
<v Speaker 1>Definitely, and I think taking that advice to try the

326
00:14:48.720 --> 00:14:51.879
<v Speaker 1>extra challenges, tweak the code, add your own jokes or sounds,

327
00:14:52.519 --> 00:14:53.840
<v Speaker 1>that's where you really make it your own.

328
00:14:53.960 --> 00:14:56.919
<v Speaker 2>Absolutely that hands on experimentation is crucial. Don't just copy

329
00:14:56.960 --> 00:14:59.519
<v Speaker 2>the code, play with it, break it, fix it. That's

330
00:14:59.559 --> 00:15:00.000
<v Speaker 2>how you learn.

331
00:15:00.480 --> 00:15:03.360
<v Speaker 1>So here's a final thought to maybe Neutilon. Now that

332
00:15:03.399 --> 00:15:09.000
<v Speaker 1>you've seen how well relatively easy Gay zero makes building

333
00:15:09.000 --> 00:15:11.399
<v Speaker 1>these interfaces, what else could you build?

334
00:15:11.559 --> 00:15:15.240
<v Speaker 2>Yeah? What everyday little tools or maybe bigger ideas or

335
00:15:15.279 --> 00:15:17.720
<v Speaker 2>even just silly concepts could you try and create with

336
00:15:17.759 --> 00:15:19.039
<v Speaker 2>a bit of Python geocode?

337
00:15:19.159 --> 00:15:21.519
<v Speaker 1>Think about it? What would you like to make interactive?

338
00:15:21.679 --> 00:15:23.720
<v Speaker 2>It's a great question. And hey, if you do build

339
00:15:23.720 --> 00:15:26.320
<v Speaker 2>something cool or have more questions as you explore, we'd

340
00:15:26.360 --> 00:15:28.879
<v Speaker 2>be interested to hear about it. Might even inspire another

341
00:15:28.919 --> 00:15:29.399
<v Speaker 2>deep dive.
