Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
Kenneth plays around with Beeware. BeeWare is a tool that transforms Python into other languages. Kenneth plays around with Toga and then contributing to the Batavia open source project.
-
0:00
[MUSIC]
-
0:05
So BeeWare is pretty cool, it's not a single project,
-
0:08
it's a whole bunch of projects.
-
0:12
So in fact, if we look here at their repositories,
-
0:15
you can see there's a bunch of projects here.
-
0:18
So BeeWare is a suite of tools that is used to turn Python into other languages.
-
0:26
And it doesn't do that by changing the code,
-
0:28
it does that by changing the bytecode.
-
0:31
So for instance, VOC here is a transpiler that will turn your Python bytecode, so
-
0:37
takes Python, compiles it into bytecode, turns that bytecode into Java bytecode so
-
0:43
that you can run your Python code natively inside the Java engine.
-
0:49
And that means that you can write Python code that then becomes Android apps or
-
0:55
just any Java app that you would want it to be.
-
0:59
So pretty cool, it's a neat idea.
-
1:01
Batavia's the same idea, but it goes to JavaScript.
-
1:04
So, This isn't production ready software just yet.
-
1:11
You don't necessarily want to use this live for your mission critical thing.
-
1:17
But it's pretty cool and it'll let you do a lot of neat stuff.
-
1:21
It's also a really, really great place if you want to go and
-
1:26
contribute to open source.
-
1:28
These are amazing projects to go and contribute to open source
-
1:33
on because the people who run it are extremely friendly and
-
1:38
they will help you get your commit merged in, getting things going.
-
1:43
But they will also,
-
1:44
it's also a great place to get to see how these languages work and work together.
-
1:52
So what we're gonna do today is, I was asking Russ what was the best thing to
-
1:57
play with on this, like if I want something that actually,
-
2:01
I can show all of you, what's the thing to do.
-
2:04
And his recommendation was to do the first couple tutorials here for Toga.
-
2:10
So I thought we'd play with Toga and see if we can get it to work.
-
2:13
I have a backup plan if it doesn't work.
-
2:15
If we can't get things to work,
-
2:17
then we will just see about how to contribute to BeeWare.
-
2:22
And I'll show you all how to do your first open source contribution.
-
2:27
So, one of these two things is what we'll end up doing.
-
2:30
So we'll see how that that goes.
-
2:31
But first, I have people saying hi to me in the chat.
-
2:34
So we've got somebody from the Netherlands,
-
2:36
which I'm not even gonna try your name because I will just completely ruin it.
-
2:40
So, hi, Netherlands people.
-
2:43
Fabio from Costa Rica, and we've got a few people from India,
-
2:47
we've got Kapil and Jenkya.
-
2:50
Sorry if I screwed that one up.
-
2:52
But, yeah, cool, hi, everybody.
-
2:54
So let's get started.
-
2:56
The first thing we probably need to do is to install Toga.
-
3:01
So let's get Toga installed.
-
3:05
So I'm gonna go to Settings, and I don't care about version control on this one,
-
3:09
not yet at least.
-
3:12
And I've got a virtual environment already set up.
-
3:15
And so now I just wanna install Toga.
-
3:19
And that's probably all I need for now.
-
3:24
We'll see about this win32, winform, we'll see about this stuff later.
-
3:27
But for right now, I think all I probably need is Toga.
-
3:31
All right, and then, we're gonna make a file.
-
3:38
Shrink this down a bit, can I make that, yes, thank you, that's so much better.
-
3:43
All right, and yeah, for right now, we're just gonna follow the tutorial.
-
3:48
And that's cool, that's fine.
-
3:49
That's how we learn stuff.
-
3:51
So let's just call this printer.py cuz this file has a button and
-
3:58
it's just gonna print some things out.
-
4:02
Hi JustZero, how are you doing?
-
4:04
So let's, no, I don't wanna undo that, there we go.
-
4:08
So we are gonna import Toga.
-
4:10
You gotta have the library if you are gonna use it.
-
4:15
And then we're gonna make this button_handler, which
-
4:20
button_handler is the thing that does a thing when you press the button, right?
-
4:26
And then it takes a widget, which that way it knows which button triggered it,
-
4:30
which widget triggered it.
-
4:33
Buttons would be a widget.
-
4:35
So this is just gonna print hello to the screen, okay, cool?
-
4:40
And then build is gonna be the app that compiles everything, or
-
4:45
app, sorry, it's gonna be the function that compiles everything.
-
4:47
And it takes an app as an argument.
-
4:50
So we're gonna make a box, so toga.Box.
-
4:55
And then we're gonna make a button, and it's gonna say Hello world.
-
5:02
And then when we press it, it's gonna do the button_handler.
-
5:08
And for the button.style, we're gonna set the margin to be equal to 50.
-
5:15
And then we're going to add the button to the box.
-
5:20
And we're gonna return the box, all right?
-
5:21
And then, of course, our if name is equal to main.
-
5:27
Then we're gonna create our app.
-
5:29
So it's gonna be a Toga app, we're gonna call it First app.
-
5:35
And then this is just like, if you've done packaging in
-
5:43
Java, where you have to specify the package location of the,
-
5:49
or the location of the package and you do your domain name in reverse.
-
5:54
So for us I'd probably do com.teamtreehouse, right?
-
6:02
Cuz that's our domain name, is teamtreehouse.com.
-
6:05
So we would reverse that to com.teamtreehouse.
-
6:08
It's a little weird, but whatever, it's fine.
-
6:11
And then we're gonna call main_loop in the app.
-
6:14
If you've done any sort of game programming,
-
6:17
this main_loop idea is pretty common, or just event-driven stuff, or asyncio stuff.
-
6:24
The main_loop idea becomes very common.
-
6:28
All right, so, let's run this.
-
6:32
No module named Toga.
-
6:35
But I told you to install Toga.
-
6:38
Did you not install Toga?
-
6:44
Let's make sure that was installed.
-
6:49
There's Toga.
-
6:55
How do you not have Toga?
-
7:02
Yeah, that looks right.
-
7:14
Okay, well let's try running this in the shell.
-
7:19
If all else fails, use the shell, right?
-
7:22
So, I wanna go into BeeWare Stream.
-
7:27
Okay, and then I wanna do virtualemvs,
-
7:33
beeware_stream, scripts,
-
7:38
activate.ps1, cuz I'm in PowerShell.
-
7:44
All right, and then python printer.py.
-
7:48
No module named Toga.
-
7:52
Okay?
-
7:57
Let's just hop into Python.
-
8:00
Import toga, no,
-
8:03
import toga_cassowary.
-
8:08
Okay, let's look at toga_cassowary.
-
8:18
That didn't help a lot.
-
8:27
Okay, .toga.
-
8:41
All right, no, Vivo, I don't think I need to restart Piecharm
-
8:46
because this isn't finding the thing either.
-
8:51
Let's see, which pip?
-
8:52
Do we have pip?
-
8:53
We do, okay, pip install toga.
-
9:05
No, not upgrade, force.
-
9:12
[NOISE] I wonder,
-
9:15
let's look at something here.
-
9:20
I got a sneaking suspicion about something.
-
9:25
Which, if I'm right, this is gonna be annoying.
-
9:35
I wanna look for win32.
-
9:42
No?
-
9:43
I know there's a package, pypi toga.
-
9:51
Duvert Town we're building all of this right now in Python,
-
9:55
at least that's our plan.
-
9:59
We will see what happens there.
-
10:01
And we got Garry from Ireland, and True revelation from Bangladesh,
-
10:05
and Nicolas from Denmark and Fremesh from Nepal,
-
10:09
he's currently hanging out in india, so that's cool.
-
10:14
So, hi everybody.
-
10:18
So 132, okay, which that's fine.
-
10:24
I'm wondering though,
-
10:28
if that fails because I am using 64-bit Python.
-
10:36
So let's come over here and let's check out Toga,
-
10:40
I'm gonna make this wider again so we can see what's going on.
-
10:45
I got the issues, Toga demo trouble, yeah.
-
10:51
Windows doesn't work, See what else we have here that might show up.
-
11:00
Microsoft Windows support, all right.
-
11:03
So let's look at these two real quick.
-
11:04
And like I said, if this fails, we'll play with something else,
-
11:07
or we'll contribute to open source.
-
11:10
No module named,
-
11:21
Someone's using the trunk version of Toga Core and Colosseum.
-
11:27
Okay, so we need to install a different version of Toga, and that's fine,
-
11:31
that's cool.
-
11:32
We can totally do that.
-
11:33
So, Okay,
-
11:43
so what it seems like we need to do is we need to be sure and be using,
-
11:48
okay there's not a trunk, okay, so let's grab this.
-
11:55
And let's go over here and let's do pip install git+.
-
12:00
And then that way we'll install Toga from core,
-
12:06
straight from GitHub instead of using
-
12:12
what's published on.
-
12:16
Okay, so now let's try this printer thing again.
-
12:20
Okay, still no module named Toga and that's cool, that's fine.
-
12:24
What's this Colosseum thing?
-
12:30
I don't know, but that hasn't been touched in forever, so
-
12:32
we are not gonna talk about that one.
-
12:33
All right, let's look at repositories.
-
12:37
Do we have Colosseum?
-
12:40
We do, we have Colosseum, okay.
-
12:45
So we need to install this as well.
-
12:50
So pip install git+ that.
-
13:00
Okay, I'm gonna let that install for a little bit here.
-
13:02
Ryan, what are we building?
-
13:04
We're not really building anything special or in particular.
-
13:08
Right now, we're just gonna follow the tutorials for
-
13:11
Toga and just kinda see what we can get going.
-
13:14
If we can't get anything going, then that's cool.
-
13:16
We'll either try to fill in a ticket on BeeWare,
-
13:21
or we'll go play with something else.
-
13:26
This has nothing to do with it being on Windows,
-
13:30
other than the fact that there is minimal support for Windows.
-
13:35
Let's completely install,
-
13:45
Toga.
-
13:45
All right, it doesn't know what purge is.
-
13:51
Yep, get rid of that.
-
13:54
Pip purge?
-
13:56
Is that a thing?
-
13:56
I think it is.
-
13:58
Now, okay, so now, let's try doing the install of Toga directly from there.
-
14:12
Okay.
-
14:20
Interesting.
-
14:25
Okay, so using the trunk version of Toga Core.
-
14:30
Is that it, is that we don't have Toga Core?
-
14:35
Let's open up Colossseum in a new tab there.
-
14:38
Toga, It should just be that, right?
-
14:45
Let's open up this demo here too, all right, so,
-
14:56
Yeah, so pulling out of here this would be,
-
15:00
this would definitely be the thing?
-
15:04
Okay, we should be good there.
-
15:06
Then, I wanted to look at this second,
-
15:11
we had a second one here somewhere, right?
-
15:16
Yeah,
-
15:26
Okay, file can't be created because it's already existed.
-
15:33
And then no module named Toga.
-
15:36
It's noted on there.
-
15:37
Windows Support's lagging behind other platforms and
-
15:40
may not leave token constraints missing.
-
15:50
Currently missing Toga part, if we're not gonna see the Toga core part is not
-
15:53
installed in the site packages folder.
-
15:54
The dist info folder's present but not the actual source folder.
-
15:57
Okay, big re-org.
-
16:00
Installing Toga on Windows won't get the expected result.
-
16:04
You'll need to manually install each of the components and
-
16:06
uninstall everything that got installed unexpectedly.
-
16:08
Okay, sort of lying on Cassowary, but
-
16:11
all the Toga core code is now referring to Colosseum.
-
16:14
This reflects a big internal change to the way, hang on.
-
16:17
Okay, so let's try this.
-
16:18
Let's try, pip freeze.
-
16:24
Okay, pip uninstall cassowary
-
16:28
colosseum toga toga-cassowary,
-
16:33
and toga-win32, all right.
-
16:38
Uninstall everything, get rid of all of it.
-
16:41
Yeah, go, just do it.
-
16:49
All right, so now if I do pip freeze I should see nothing.
-
16:53
All right, cool.
-
16:56
So now, lets pop up here and let's install Toga, Straight from GitHub.
-
17:05
All right, and then let's install Colosseum straight from GitHub.
-
17:19
Which this one takes a little while.
-
17:20
I'm kinda surprised by how long this one takes.
-
17:24
Andrew, well, right now we're just trying to get Toga and friends installed and
-
17:28
somewhat happy, which is just not working.
-
17:34
Okay, let's open up a new shell.
-
17:41
And let's go check out our virtual ENV.
-
17:44
So, beeware stream, that was what this one's called.
-
17:50
All right, so then, we wanna go look at lib, and then site-packages.
-
18:04
And yeah, we don't have Toga itself, right?
-
18:08
Cuz we end up getting basically what was there, right?
-
18:14
So there'll be a Cassowary.
-
18:17
There we go, a readme for whatever reason.
-
18:20
Then we've got a Toga, toga_cassowary.
-
18:25
We didn't install toga_demo,
-
18:29
let's try the Toga demo as well.
-
18:33
We will install that directly from here as well.
-
18:39
If in doubt,
-
18:42
install from GitHub.
-
18:49
Okay, so that thinks everything is cool.
-
18:50
Yeah, but you have no module named Toga, and that's true,
-
18:56
you don't have a module named Toga because if we look in here,
-
19:01
there's not anything named Toga.
-
19:09
What's in utils?
-
19:12
Something else, okay.
-
19:17
ThePrag Pares, what is toga?
-
19:20
Toga is a platform independent, well, supposedly,
-
19:25
platform independent library for building applications
-
19:31
in Python that will run on natively in different OSs.
-
19:36
This isn't exactly that.
-
19:42
Like we're not able to get that going right now.
-
19:45
So what I'm wondering, What's
-
19:51
in Toga, That's a directory, okay.
-
20:01
So that just lists a bunch of stuff.
-
20:04
It doesn't actually say that Toga is in there.
-
20:09
So what if we see if we
-
20:14
could set up that pie, okay.
-
20:18
So they do that to get the version number.
-
20:24
There, they installed that.
-
20:26
If it's x, if it's required.
-
20:29
But other than that there's not really anything special, okay.
-
20:32
So, if I was to do an ls, let say, toga_cassowary,
-
20:36
I've got like that kind of stuff.
-
20:39
Let's go look at toga_cassowary real quick Can we not, no?
-
20:45
Okay.
-
20:49
So I'm wondering.
-
20:56
If I was to just take this and do git clone, that,
-
21:00
I don't recommend doing this everybody.
-
21:05
Just so you know.
-
21:07
But let's just see what it does, right?
-
21:10
It doesn't hurt anything.
-
21:24
Look at that, we're getting closer, all right.
-
21:26
So I think what I wanna do instead is I think I wanna do,
-
21:39
And then that, and then scripts, and then activate.
-
21:49
Okay, so then you go into Toga, do python \setup.py.
-
21:56
Install.
-
22:08
It installed the egg.
-
22:20
I don't know if that did what I wanted it to or not.
-
22:24
That did not do what I wanted.
-
22:34
There's the egg, which I mean, the egg is fine.
-
22:56
That put the egg in there, okay.
-
22:59
Okay so then let's move,
-
23:06
toga to be like toga-src.
-
23:13
Now it doesn't have anything named toga.
-
23:20
NV toga- that, just be toga.egg.
-
23:45
So let's try copying that over to toga.
-
23:51
I don't think that's going to work either, but let's give it a try.
-
23:55
All right, let's not worry about Toga.
-
23:58
Let's do something different.
-
23:59
So I'll leave this up to chat for a minute.
-
24:02
Would you rather have me do a stream on how to contribute to open source?
-
24:10
And we'll try and do something with BeeWare,
-
24:17
we'll try and commit some stuff.
-
24:22
Or, would you rather me do some other fun thing to play with?
-
24:31
So go ahead and chat,
-
24:36
Give me an idea of what it is you would like to do.
-
24:41
Cuz yeah, this is just not, this is just not gonna work.
-
24:48
So, I'm not going to fight it at this point,
-
24:55
because that seems silly.
-
24:59
It seems very silly to fight this.
-
25:01
So, do we want to contribute to open source by likely working on Batavia.
-
25:10
Or, do we want to do something different?
-
25:14
So, I've got an idea of playing with Click or Google Fire,
-
25:18
I've put out a poll on Twitter and a lot of people voted for GraphQL.
-
25:23
And I wanted to do GraphQL.
-
25:27
GraphQL is not useful unless you have a lot of different data stores, right.
-
25:33
So you have a lot of databases and then GraphQL is really handy.
-
25:38
If you just have like one database and
-
25:40
it just has a few things in it, GraphQL is useless.
-
25:44
Like it's just completely, it's not a thing you need at all,
-
25:50
in any way, shape, or form.
-
25:53
So, yeah, what would y'all like to see me cover?
-
26:01
And I will gladly, will start talking about stuff.
-
26:08
You wanna see how to contribute Vivo, okay,
-
26:13
we can do that, we can try and do a contribution,
-
26:18
contributions are a lot of fun.
-
26:24
So I actually wanna do deactivate, I'm just going
-
26:28
to whatever, pip install, I have pip, right?
-
26:36
Yeah, okay, cool, pip install cricket.
-
26:42
Excuse me, cricket is also a BeeWare project.
-
26:49
Cricket.
-
26:50
Cricket is pretty amazing.
-
26:51
Cricket is a tool for running your,
-
26:59
Tests, that's what they're called.
-
27:01
They're called tests.
-
27:02
For running your tests, and,
-
27:05
what makes it really cool is that it doesn't need.
-
27:11
You don't know what Cricket is?
-
27:14
Okay, so
-
27:16
AppData\Local\Programmes\Python\Python36\- Scripts,
-
27:25
Cricket?
-
27:28
Cricket Unit test, okay, there we go.
-
27:32
So this is cool because you can run this in your test suite and
-
27:37
then it'll give you a visual thing of all your tests.
-
27:43
No Peter, this is not still part of Django Feelings.
-
27:47
We're done with Django Feelings for a while, and
-
27:50
we're going to play with other parts of Python for a bit.
-
27:55
But so let's see about contributing to
-
27:59
the open source stop here in BeeWare cuz BeeWare is pretty awesome.
-
28:03
I really love helping out on BeeWare as much as I can.
-
28:08
Now BeeWare has two main areas that people contribute to.
-
28:13
One of them is Voc which is the Python to Java converter and Batavia,
-
28:18
which is the Python to JavaScript converter.
-
28:21
Now I know JavaScript way better than I know Java.
-
28:28
So, Batavia is the one I'm going to help out on.
-
28:32
I don't know, I don't really know anything at all about Java.
-
28:37
I don't know anywhere near enough about Java, rather, to help with it.
-
28:42
So, let's talk about Batavia.
-
28:44
Batavia is pretty cool.
-
28:47
It is a really neat library.
-
28:55
Yes, Evolved, cricket is a sport.
-
28:58
It's a really neat library that turns your Python code into JavaScript code.
-
29:03
Let's see if we can get it to actually work.
-
29:06
So I'm going to copy that and I want to clone this.
-
29:15
I will clone it at F:\Projects\beeware_stream\.
-
29:20
I'll clone it into here.
-
29:22
I'll get rid of that printer.py cuz we don't need that anymore.
-
29:27
All right, so we're gonna clone Batavia into here.
-
29:32
And Batavia is really cool.
-
29:34
Like I was saying, it'll turn your Python code into NPM.
-
29:37
So, or into NPM, wow, into JavaScript.
-
29:41
So, what's cool is that means you can write Python and
-
29:46
then you can turn that into JavaScript and run it in a browser or
-
29:51
wherever you want to install it!
-
29:56
Okay, so now, we need to do,
-
30:02
Virtualenvs\beeware_stream\Scripts\activ- ate?
-
30:10
Okay, and then I'm gonna do a pip freeze.
-
30:13
I wanna get rid of all of these, so we're gonna do a pip uninstall.
-
30:18
Cassowary colosseum toga toga-cassowary
-
30:24
toga-demo, and toga-win32.
-
30:30
We're gonna get rid of all of those.
-
30:33
Yep, that's true,
-
30:36
I do have to spell colosseum correctly.
-
30:42
Where did I screw up on that?
-
30:43
Colo.
-
30:50
Pip, uninstall C-O-L-O-S-S-E-U-M, that's how you spell it.
-
31:02
Y'all get to see the fact that I can't spell as well as you thought I could.
-
31:13
Okay, and then we're gonna do pip install.
-
31:19
Marcus, how does it handle things like Mixins?
-
31:23
I'm not sure what you mean by Mixins.
-
31:26
I have NPM available right?
-
31:34
Yeah, okay so then we can do NPM.
-
31:37
Run build.
-
31:52
I think I remember.
-
31:53
There was a problem with this.
-
31:54
It had required an older version of NPM, of Node 6.9.1.
-
32:00
So if we do npm --version.
-
32:10
Yeah, that's it.
-
32:11
So we have a newer version of Node than they expect.
-
32:16
And so it doesn't work, which is disappointing.
-
32:24
It's sad.
-
32:28
That it doesn't work with that.
-
32:30
And I don't wanna install an older version of MPM.
-
32:33
That seems kind of silly, so let's not do that.
-
32:42
4.0 or greater, really?
-
32:46
Npm version is that, npm, istalledsgnpm.
-
32:52
I don't think this will work.
-
32:54
Let's find out though.
-
32:55
It doesn't hurt have a newer thing like NPM.
-
32:57
So yeah, Marcus, what do you mean by Mixins and how does it handle Mixins?
-
33:02
You mean like the class base Mixins that we have in Python, or something else?
-
33:08
Cuz I'm not sure what you mean there.
-
33:23
[COUGH] Excuse me.
-
33:35
So, we're just waiting on NPM to install right now.
-
33:39
If we can get Batavia to run then that's cool, if we can't it's fine.
-
33:41
We can still run the test and try to do a commit.
-
33:50
So, there's a lot of commits here for Batavia, as you can see.
-
33:56
There's quite a few sitting here working on this.
-
33:58
What Batavia requires is Batavia needs to have a,
-
34:04
there needs to be a full version of effectively the Python
-
34:10
core library written in Java Script which is what Batavia needs.
-
34:17
So, if we, let's pop over here to the issues.
-
34:22
And, I don't want to do any
-
34:28
of the Google summer of code ones.
-
34:35
Let's see I'm trying to find a good one here that would work well for
-
34:39
contributing.
-
34:47
Because while there's a lot of these, and a lot of them are good for
-
34:50
contributing, I don't want to steal anything away from easier stuff.
-
34:53
Here we go. This is a good one.
-
34:57
So we'll go with this Complete implementation of operations
-
35:00
on standard types.
-
35:01
So let's look at this one.
-
35:10
Maybe not that one.
-
35:11
Maybe this one instead.
-
35:15
What can we create with Python, vine vine asks.
-
35:19
Python is pretty open, you can kinda create anything you want with Python.
-
35:27
Yeah, there's not a whole lot of stuff that's missing, so
-
35:31
I guess figure out what it is that you want to do.
-
35:39
Victor, we're not coding anything at the moment actually,
-
35:43
right now we're kind of, we're kinda playing with Batavia.
-
35:48
We're gonna look at maybe committing or
-
35:50
contributing to the open-source project Batavia.
-
35:54
So and we're gonna kinda just walk through what Batavia does and how we'd work on it.
-
35:58
Vine vine, what kind of apps?
-
36:02
So Python is best for doing like web apps versus doing,
-
36:07
like it won't build native mobile apps, it won't build native,
-
36:14
well you could build native desktop apps using Tkinter.
-
36:19
But, that's neither here nor there.
-
36:22
So for the most part Python runs on the back-end, back behind web apps.
-
36:28
Okay, cool, so now we need to do NPM install,
-
36:32
which that should just install the bits and pieces that we need.
-
36:37
We'll let that run for a minute.
-
36:39
Npm install, okay,
-
36:43
we'll have to do that in a minute.
-
36:50
So Python runs behind a lot of apps.
-
36:52
For instance, Python runs behind Instagram.
-
36:54
It runs behind a lot of Facebook's stuff.
-
36:57
It runs behind YouTube, it runs behind Pinterest,
-
37:01
it runs behind Venmo, if you've used Venmo, the payment thing.
-
37:09
So yeah, there's also places where Python runs behind things.
-
37:13
Vortex dude, what kind of programming language or
-
37:15
languages do we the node to make an OS?
-
37:21
Most OSs are written in C or C++.
-
37:24
You typically want something that runs much lower level than,
-
37:29
like say, Python or Ruby, or whatever would run.
-
37:35
But once you have that base level running nicely
-
37:38
you can kind of build the rest of it on whatever you want.
-
37:44
Mac is written in Object-C and C++ and a few other random languages.
-
37:51
Windows is written in C++, C, C#, all that kind of stuff.
-
37:58
Okay, so there was a message up here about, something about, webpack.
-
38:04
Let´s see if we can find it.
-
38:08
Wow, that's a lot of output.
-
38:12
[COUGH] Excuse me all.
-
38:14
All right, so we want to do npm install
-
38:18
babel-preset-env --save-dev.
-
38:23
Okay.
-
38:26
Did that by any chance, where did you go?
-
38:32
There it is.
-
38:37
No, all right, I was hoping, okay.
-
38:43
Npm install babel-preset-env --save-dev.
-
38:48
All right Ctrl+C, does that work, ha, it did, sweet.
-
38:55
So yeah, so you typically want to build something that runs really fast at
-
38:58
the base of your operating system.
-
39:03
And then you can have slower and slower things as you move up the stack, right?
-
39:07
Because while applications should ideally launch quickly and
-
39:12
run quickly, they could be written in something that runs a little
-
39:17
bit slower because this just drawing to the screen or whatever.
-
39:22
I think we're supposed to do npm build, that was it.
-
39:31
Okay npm run build.
-
39:36
See if this works.
-
39:39
It's doing something.
-
39:47
Then we can try running Python in our browser.
-
39:50
Justin, when did YouTube start doing live streams?
-
39:53
A while back, I guess?
-
39:57
I don't remember exactly when they started doing it.
-
40:00
But I know they started doing it a little while ago.
-
40:05
Okay, so we should have a test server.
-
40:06
We do, look at that.
-
40:09
We have that test server directory.
-
40:11
And then, once we're inside there,
-
40:15
we can do pip install -r requirements.
-
40:19
Which, that won't solve everything from the requirements file.
-
40:30
And then, once that's installed, we should be able to launch this Batavia testbed.
-
40:38
Hey Lionohtiger!
-
40:40
Right now we're getting Batavia installed and set up.
-
40:43
We're gonna contribute to some open source here in a little bit once we have Batabia,
-
40:47
Batavia running.
-
40:49
Today's episode is kind of more relaxed than a lot of ours.
-
40:52
There's not necessarily an end goal.
-
40:55
We're just trying to play with some open source software.
-
40:59
See what we can find, see what we can do.
-
41:02
Just kind of learn and explore a little bit.
-
41:04
So hang out if you wanna hang out.
-
41:08
Help solve any problems that come up, contribute ideas.
-
41:15
Yes, Paws, I have my challenge coin from Russ.
-
41:20
I've had mine for,
-
41:23
it'll be a year in July, so yeah.
-
41:27
Okay, cool, so we've got that going.
-
41:32
We should be able to do python
-
41:36
manage.py runserver.
-
41:44
It hasn't actually stopped.
-
41:49
[LAUGH] Okay, not in here.
-
41:55
Let's see if I can.
-
42:01
So let's go to terminal, just writing this in here.
-
42:05
And then Batavia, and then test server.
-
42:20
Okay, and then python manage.py runserver.
-
42:27
Okay, cool.
-
42:28
So now if we try to go to our local host, Cool, here's our Batavia testbed.
-
42:34
So now here's what's really cool is we can do stuff like for
-
42:41
x in range [10]; print {x squared}.
-
42:47
And then we can run it.
-
42:54
Unknown opcode.
-
42:57
Do you not know how to do it?
-
43:02
Unknown opcode 0, that's fun.
-
43:11
Let's try something a little easier.
-
43:13
Let's just do print ("hello world").
-
43:22
We're getting all sorts of fun console output, aren't we?
-
43:39
Okay, so PyStone is working, sample.py is not working.
-
43:44
Can't read property 'int32' of undefined.
-
43:47
Interesting, all right.
-
43:49
So somebody was saying how do we know what needs fixing on GitHub?
-
43:53
And yeah, you pretty much just go look at issues, right?
-
44:00
And you just see what these issues are.
-
44:01
And some of these are really,
-
44:04
really simple issues that somebody just needs done, right?
-
44:10
So "inside the button" example in tutorial 1 doesn't work.
-
44:14
So the name of the output element ID has changed from "stdout" to "pyconsole".
-
44:18
But that change doesn't reflected in this tutorial text.
-
44:20
So that's cool, that's a really quick, simple, easy thing to go fix.
-
44:25
In fact, one of you should go do that right now.
-
44:27
Clone Batavia, change that in the text, submit it, right?
-
44:31
Make sure that change actually works, but submit it.
-
44:33
That's really simple and easy.
-
44:35
Some are gonna be much harder.
-
44:37
These ones that you see here labeled as GSOC,
-
44:40
Google Summary of Code, those are going to be more difficult ones for people to do.
-
44:43
But there're still pretty awesome ones, and
-
44:47
they will be absolutely amazing once they get all the way done.
-
44:52
So I really somebody gets those underway soon.
-
44:56
So I don't think our thing is gonna run.
-
44:59
And I bet it's because we're not on the right version of Node.
-
45:06
it's weird, though, that it ran that far.
-
45:13
I wonder if we should do?
-
45:16
Let's come back out here.
-
45:18
compile_stdlib, so it compiled it.
-
45:31
'undefined' is not defined.
-
45:34
That's true, [LAUGH] undefined would be not defined.
-
45:41
Let's trying printing 1.
-
45:48
Do I still get 'undefined' is not defined?
-
45:53
Yeah.
-
46:01
Hm, that's interesting that that's just not running at all.
-
46:07
Also my mouse has stopped scrolling.
-
46:11
Issue related to running sample.py.
-
46:12
Yeah, there is something wrong with running the sample.py.
-
46:16
So let's not worry about those.
-
46:18
I mean, we can look at it real quick, if you all wanna see it.
-
46:21
Cuz this is kinda cool, this is supposed to run as Python.
-
46:24
So we get dom and the other,
-
46:30
we build up points.
-
46:34
We try out some different mixins and things like that, right?
-
46:38
So that's pretty cool that we get to do stuff like that and it works.
-
46:43
Okay, so let's cancel this, kill that terminal.
-
46:49
Get rid of that, turn off that.
-
46:52
All right, so, It's alive!
-
46:58
It's actually not alive, But that's fine.
-
47:12
Yeah, see, this is the one there.
-
47:13
It's no longer called stdout, it's now called something else.
-
47:17
So that's the one to go change.
-
47:19
All right, so let's not worry about this part.
-
47:29
Yeah, but I do recommend that you go and read Why Batavia?
-
47:34
Russ is absolutely amazing at naming things.
-
47:40
So, yeah, let me go back to chat, there's some more questions here.
-
47:43
So vine vine, you're confused which language you should learn for
-
47:47
creating mobile apps.
-
47:49
So it depends on the platform you wanna do.
-
47:51
If you wanna build for iPhones and
-
47:55
iPads, you wanna learn Objective-C or, more likely, Swift.
-
47:59
If you wanna build for Android phones and tablets,
-
48:04
then you're gonna want to learn Java or Kotlin.
-
48:09
There are ways to do like Python to Objective-C or Python to Java for Android.
-
48:16
Things like Kivy are really popular for that.
-
48:18
They're not necessarily great.
-
48:21
Lots of times they fall a little short,
-
48:23
make things are a little weaker than you would like.
-
48:27
TheVortexDude, can I start making an OS?
-
48:31
No, I have absolutely no idea how I would start making an OS [LAUGH].
-
48:35
I read a thing a little while back of how to build your own programming language,
-
48:38
and I thought that was kinda cool.
-
48:40
But I need learn a lot more about C and C++ before I even start doing that.
-
48:45
So I'm not going to start that, yeah.
-
48:52
Pause, there's an issue about sample.py.
-
48:54
Is there?
-
48:56
I'll check that out.
-
49:00
Mm, true!
-
49:13
Hm, okay, cool, that's neat.
-
49:17
Ryan asks why do we need backend languages.
-
49:20
I know we need it for databases, but what else?
-
49:22
I mean, I guess we could make any web app with frontend.
-
49:24
What is it wit backend language that we really need?
-
49:28
So you need the processing power of someone else's computer
-
49:31
on the frontend, right?
-
49:34
And you don't want to do heavy calculations on someone else's computer.
-
49:39
And you can't really use someone else's computer to send an email.
-
49:42
So that has to live on the backend.
-
49:44
And you can't really use someone else's computer to store files.
-
49:47
So that lives on the backend.
-
49:50
The backend is where all the heavy lifting is done when it comes to applications.
-
49:55
The frontend is perfectly good, solid work, but not
-
50:03
Not work that is the same.
-
50:10
So yeah.
-
50:12
Taco, do we offer a student discount at Treehouse?
-
50:15
I don't believe there is a student discount.
-
50:18
There is a free trial and
-
50:21
there should be some links like in the show notes or there may be like a little I
-
50:26
up on one side of the screen that has a link that will get you somewhere.
-
50:32
And I think that has some sort of extra bonus thing, but I don't know for certain.
-
50:38
I'm not not responsible for any of that part.
-
50:41
And Ryan Skits, should you code even if you're a kid.
-
50:46
Sure, if you can figure out how to do the code, do the code.
-
50:52
This isn't what I was looking for, what was I looking for?
-
50:56
Batavia, let's search by first timers only.
-
51:06
Operations on standard types?
-
51:08
[MUSIC]
-
51:21
I think this is the one I was looking for.
-
51:23
All right, so let's look at this, let's not look at the test server.
-
51:29
We want to look at Batavia itself,
-
51:35
and we wanna look at this kind of stuff.
-
51:40
So, if we go over here and we look at tests data types.
-
51:48
And so like let's say that we're gonna work on I like tuples,
-
51:53
let's work on tuples.
-
52:00
We've got all these different cases that come in.
-
52:02
And, but Batavia's tests are pretty awesome because of,
-
52:09
how this stuff is being done.
-
52:12
So we had these trans file test case unary operation test case,
-
52:15
binary operation test case, and end place operation test case.
-
52:18
So these supply all the random data to our types and
-
52:24
get the expected outcome, right.
-
52:30
So they should all pass.
-
52:32
All the tests are marked as they're supposed to fail.
-
52:35
So, if they suddenly pass, then you're like hey, sweet.
-
52:40
I did the thing that you wanted me to do.
-
52:42
So, that's how you know whether or not you did the right thing.
-
52:46
So you can see stuff here where it's like expected failure, right.
-
52:49
This test is supposed to fail.
-
52:52
So we wanna make this test not fail, all right?
-
52:58
So that means we need to go and look at tuple.
-
53:03
So we don't need tuple tests and we don't need test tuple.
-
53:10
We need, That one?
-
53:15
Nope, not that one, we need that one.
-
53:22
All right, so.
-
53:27
These are where we have all of these.
-
53:30
Functions and methods and stuff.
-
53:33
Right, so you can see here,
-
53:35
we've defined the __eq__ method which is the equality method.
-
53:42
We're defining that on the Tuple prototype.
-
53:43
It's gonna be this function that takes this other and
-
53:46
then we run all this logic about to figure out whether or not it's this other thing.
-
53:52
So the one that we're looking for is we want to find setattr so
-
53:57
let's look through this file, oops,
-
54:05
Look through this file for setattr, which doesn't exist, doesn't exist anywhere.
-
54:15
So, normally that would be done in __setattr, but
-
54:20
I don't know if that's where we wanna do it.
-
54:27
Get item, This may not be
-
54:35
the one that we wanna fix cuz I'm actually not sure where this one would get fixed.
-
54:39
Yeah, let's not worry about that one for right now.
-
54:43
Let's find another one that's expected to fail.
-
54:54
Is that the only one?
-
54:54
[LAUGH] It's horrible, that's the only one.
-
55:04
Okay, so we've got some things here that aren't implemented yet.
-
55:12
And I wonder if that's because those things just don't work for
-
55:15
in-place operations.
-
55:20
Yeah, you can't do anything on a two-pole for in-place.
-
55:22
Okay let's find a different one then.
-
55:27
Let's try test,
-
55:35
test, let's try test_int.
-
55:49
No, not test_int.
-
55:50
test_list, I know a little bit about Looh, but not a whole lot.
-
55:57
I built one thing in Looah, Over the years.
-
56:04
And Looah's cool, but it's not one that I know a ton about, so I can't say.
-
56:13
You know a whole lot about it.
-
56:16
You can learn python on Treehouse, you can learn C# on Treehouse,
-
56:21
you can learn Rubi and HTML and CSS and all sorts of stuff.
-
56:28
I am for some reason not seeing the test that I need to fix here.
-
56:37
Yeah, those are all fine!
-
56:48
Mm-hm, that could be a fun one!
-
56:52
Some iterator, okay.
-
56:55
Let's see if we can find where that one is defined.
-
56:59
And then maybe we can make that work.
-
57:28
So this is virtually handy to have somebody who knows what
-
57:31
they're doing when it comes to these tests next to you.
-
57:35
Is there a capital I?
-
57:38
Now we've got different kinds of iterators.
-
57:43
Okay, so let's look at okay,
-
57:47
I think this is closer to what we want.
-
57:53
Or, do we have anything about sum.
-
58:11
A and B could fail to add the many possible typing compatabilities,
-
58:13
all of which are needed to be reflected in this error message.
-
58:15
But we don't have to check for
-
58:16
them here because they have already been tested for in __ad.
-
58:20
It's true, so why does that test fail?
-
58:29
Why is that test listed as expected failure?
-
58:32
I don't know, all right,
-
58:37
so this is turning out to not be the fun thing that I thought it was going to be.
-
58:41
So, we got a ton of expected failures in there,
-
58:50
so let's try something else.
-
59:02
So I'll tell you what,
-
59:04
we started off with we were going to build some sort of GUI thing.
-
59:12
So let's play with that, let's play with Tkinter.
-
59:16
Tkinter is not the most amazing thing ever, but
-
59:21
let's give it a try cuz Tkinter is fun.
-
59:25
So let's make a, Let's make a Tkinter script,
-
59:34
Build a little Tkinter app and we'll use that to convert temperatures
-
59:39
between Celsius and Fahrenheit and Fahrenheit to Celsius okay?
-
59:44
Does that sound easy enough?
-
59:49
We'll give that a try.
-
59:50
So, Victor said a lot of people and mainly students are good at coding.
-
59:53
What really gives you the experience to become great and
-
59:56
the freedom to mainly work easily on anything?
-
59:59
The secret to succeeding at literally anything, Is practice,
-
1:00:04
especially with something like Python, that's just a skill, right?
-
1:00:10
Programming, programming isn't something you're born with.
-
1:00:14
Nobody's born knowing how to program.
-
1:00:15
Some people might be better at it than others because they think
-
1:00:21
logically better, or there better at the math side of it or whatever, right?
-
1:00:26
But absolutely anybody and everybody can do programming, it's just a matter of
-
1:00:33
learning the language, learning the constructs, learning those things, right?
-
1:00:38
That's it.
-
1:00:39
So you can go and build anything you want in programming, you just have to learn
-
1:00:44
the language that you want to play with and things like that.
-
1:00:48
So don't feel like you have to know, you have to be born with some sort of thing.
-
1:00:54
Cuz that's not the way it is.
-
1:00:56
Zander says Lua is definitely a weird language to the other languages.
-
1:01:00
When I started learning JavaScript, I had a bad habit about leaving out semicolons.
-
1:01:02
Yeah, Lua is very, Lua is very strange.
-
1:01:06
Lua is neat and it's cool but it has so many just weird little bits.
-
1:01:11
But I haven't gotten quite into it yet.
-
1:01:17
Not enough to be like, yeah, Lua is amazing.
-
1:01:20
So, at some point I think I'm gonna try and do a Lua livestream and
-
1:01:26
we'll all learn Lua together, we'll all play with Lua, together.
-
1:01:30
But that's gonna be a little ways off.
-
1:01:33
So we're not gonna worry about that for now.
-
1:01:36
And vine vine asks what motivated me to start coding.
-
1:01:40
So, I was working on a game with some people online and
-
1:01:47
I was doing the art work cuz I have a art degree,
-
1:01:53
a design degree rather.
-
1:01:56
And the art for the game I was working on tiles like for the ground plane.
-
1:02:01
And it was going to be offset, so if this is a tile, the next tile would be
-
1:02:05
next to it, but halfway down, and of course it would be one halfway up.
-
1:02:10
And I couldn't get it laid out well in my image program to where I could test and
-
1:02:16
edit this, this was in the year 2000-2001.
-
1:02:20
So, I was telling them I'm having a hard time getting this to work, and
-
1:02:24
they are like, here, let me give you a script, that will lay it out for you.
-
1:02:28
And they gave me a PHP script that would generate the necessary HTML for me.
-
1:02:35
And that was amazing, I couldn't believe it.
-
1:02:39
So I started digging into that.
-
1:02:40
And at the same time I was doing an internship for my school, for
-
1:02:45
my university, and that was done mostly in PHP.
-
1:02:52
So I was picking up PHP from that as well.
-
1:02:55
And then I started helping a friend of mine on his forum.
-
1:03:01
That was done in PHP, and that needed some code.
-
1:03:03
And so just all these things where I was having to write some code, and
-
1:03:07
I was just like, programming is pretty fun.
-
1:03:10
I'd done HTML, CSS, Javascript, ActionScript,
-
1:03:14
all this Shockwave, all this stuff back in the past before, but
-
1:03:19
this is the first time like programming, programming.
-
1:03:21
And it was really fun.
-
1:03:22
And I just decided to do that from now on and instead of design, I liked it better.
-
1:03:30
Ryan says Java or Python be honest.
-
1:03:33
Python and I mean do I even have to,
-
1:03:38
did any of you think it was something else?
-
1:03:42
But that said, Java is a pretty awesome language.
-
1:03:44
All right, so here is what we are getting done.
-
1:03:51
We're gonna build this little thing here and
-
1:03:55
right now it's just pretty application that doesn't do anything special.
-
1:04:00
And we're just gonna go along with the tutorial for right now.
-
1:04:04
And I know a lot of you are like, why does he do tutorials all the time?
-
1:04:09
And I do tutorials all the time because tutorials are a great way to learn stuff.
-
1:04:15
And you watching me follow the tutorial is still good for both of us, right?
-
1:04:21
So we just have to get through these things.
-
1:04:27
And then we can go and build whatever stuff we want after that.
-
1:04:32
So if you don't know what tkinter is or what tk is, tkinter and tk are.
-
1:04:40
Well, so Tk and Tcl is a really old programming language that's used for
-
1:04:46
building GUI applications using windows and stuff, right?
-
1:04:50
Not Windows the operating system but windows like a window on the screen.
-
1:04:54
And TkInter is the Python Tk interface,
-
1:04:59
TkInter, for, For using Tk.
-
1:05:04
And what's cool is it's built-in, so you can just start playing with it.
-
1:05:17
And hi_there.pack, side=top, self.quit.
-
1:05:29
QUIT, foreground is red and
-
1:05:33
the command = root.destroy.
-
1:05:41
And then let's make say_hi.
-
1:05:46
And we're just gonna print, hi there, everyone.
-
1:05:50
Okay, and then let's get down here to root.
-
1:05:53
So root is going to be tk.Tk,
-
1:05:57
app is an instance of our application where the master = root.
-
1:06:03
So that's just the core of everything that's running.
-
1:06:06
And then we're gonna do app.mainloop.
-
1:06:09
And you can tell this is like older Python because of weird things like
-
1:06:14
feeding in the instance here.
-
1:06:17
And like it being mainloop instead of like a main underscore loop or
-
1:06:21
anything like that.
-
1:06:23
It's really weird getting to see, Like old Python.
-
1:06:26
So can you all see this window here I'm, I don't know if I'm gonna be able to move it
-
1:06:31
up, let's see, well, I can make it bigger.
-
1:06:36
There we go.
-
1:06:39
So we have a button that says hello world, click me.
-
1:06:42
And when I click it, it prints, hi there, everyone, down here.
-
1:06:46
So I forgot to do one step, let me go back and add that in real quick.
-
1:06:50
We wanna do pack side = bottom.
-
1:06:55
Okay, let me run that again, there we go.
-
1:06:58
Now we have two windows or two buttons in one window.
-
1:07:03
So this one says, hello world click me.
-
1:07:05
I know it might be a little small, but you can see it there.
-
1:07:08
And then this one says QUIT.
-
1:07:10
So Hello World, that'll print hi there, everyone, every time I click it.
-
1:07:14
And QUIT will quit.
-
1:07:17
Cool, so let's talk about couple other things here.
-
1:07:24
We want to, the packer is cool but, The packer is a little bit strange, right?
-
1:07:33
So what the packer does is the packer, just the packer went in together and
-
1:07:38
make it fit, make it fit nicely.
-
1:07:41
So you can specify which side of the box it's on, so it's on the top of the box,
-
1:07:45
the bottom of the box, left or right of the box.
-
1:07:48
You can specify whether or not it expands.
-
1:07:51
You can specify where it's attaching things to, and then you can part it.
-
1:07:58
So let's try doing these, so that it say, we'll leave that as top,
-
1:08:03
we'll leave that as bottom.
-
1:08:05
Let's do expand = 1 on that one and see what that does.
-
1:08:09
That didn't do anything, okay?
-
1:08:19
That didn't do anything either, okay?
-
1:08:22
So, that's a Boolean.
-
1:08:25
I shouldn't have to do that.
-
1:08:30
Yeah, that didn't change anything.
-
1:08:35
Okay, there's what we want, we want fill and we want to fill on x.
-
1:08:40
We wanna go this way.
-
1:08:44
Sweet, so here's our window.
-
1:08:46
Our window's actually smaller than what you see, right?
-
1:08:52
But you see now that QUIT has expanded out to be as wide as the other stuff
-
1:08:56
in our little packed area.
-
1:09:00
So that's cool.
-
1:09:02
Let's see if we change this to both.
-
1:09:09
Yeah, nothing special.
-
1:09:10
It was already filling up as much room as it could.
-
1:09:16
Okay, let's see, we've got some more things here.
-
1:09:17
Vine Vine asks which apps I'm most likely to create?
-
1:09:24
I mean, I make all kinds of different stuff.
-
1:09:26
So I don't really know.
-
1:09:35
We kinda build whatever, right?
-
1:09:37
We build the stuff that we need to build.
-
1:09:43
There we go.
-
1:09:45
So that's kinda cool.
-
1:09:47
Playing with where the stuff is arranged.
-
1:09:50
And then, Dimer asks, which language to start with?
-
1:09:56
I think Python or JavaScript are really languages to start with nowadays.
-
1:10:02
There are a lot of really great languages out there.
-
1:10:07
But Python and JavaScript are the two that are probably
-
1:10:12
the easiest to get into as far as all of this stuff.
-
1:10:18
They're also really easy to
-
1:10:22
get into as far as there's not a lot in your way of playing with either of them.
-
1:10:30
So, yeah, those are the ones I go with.
-
1:10:47
So now we have this window, but now it says,
-
1:10:53
say Hi, because we set the title right there.
-
1:11:00
And I can't make it any taller than 100 pixels.
-
1:11:04
So that's cool and I can't make it any wider than 500.
-
1:11:09
So that's neat, that's fun I guess.
-
1:11:13
[COUGH] excuse me.
-
1:11:15
And then, asks what are the hardest programming languages?
-
1:11:20
Usually the hardest languages are the older ones, because they are harder to
-
1:11:27
find help and support for, harder to find like value, not values,
-
1:11:33
documentation and stuff simply because they're older right?
-
1:11:39
So you often don't want to, you don't wanna get stuck in those, all right?
-
1:11:46
Simeon, how come Tkinter, isn't it outdated, isn't Qt better?
-
1:11:51
Yes and no, Qt does not come pre-installed in Python, Tkinter does.
-
1:11:57
Also, Qt has some weird licensing things around it.
-
1:12:02
It's really neat, but at the same time, it has things that you may or
-
1:12:06
may not want to be involved in as far as licensing goes.
-
1:12:10
So there's a lot of, especially with commercial software,
-
1:12:14
Qt has some very strange licensing requirements.
-
1:12:17
[COUGH] Okay so let's talk about storing stuff.
-
1:12:21
I said I wanted to do conversion of temperature from one end to another right?
-
1:12:28
So we need to have float values for either one of those right,
-
1:12:34
because both Fahrenheit and Celsius can be, floated.
-
1:12:39
They both have decimal values, they can both be floated.
-
1:12:42
So we're gonna hold on to a double var, we want a double.
-
1:12:49
So let's go ahead and
-
1:12:53
hold onto these in here.
-
1:12:59
So let's do f_input = tk.DoubleVar() and
-
1:13:07
c_input = tk.DoubleVar().
-
1:13:14
And then down here let's make a couple of
-
1:13:19
new widgets that we can use that are ones
-
1:13:24
that allow people to insert things.
-
1:13:28
So self, or actually, this shouldn't be f.input
-
1:13:34
this should be f.input_val [SOUND] and wow and
-
1:13:39
f_input should be tk.entry and c_input = tk.entry.
-
1:13:45
And let's put these next to each other.
-
1:13:50
So f_input.pack(side = 'left') and
-
1:13:55
I want to do the same thing here for c_input.
-
1:14:01
And I'm gonna ditch Hi there and Hay hi and
-
1:14:06
this can go back on the autumn and can fill the x again.
-
1:14:15
Okay let's see what this looks like.
-
1:14:18
And we've got one and we've got two, so there they are.
-
1:14:24
So we probably need to put some sort of label on those, right.
-
1:14:27
At this point, they're really hard to see, and
-
1:14:32
they'd be really annoying to try and use.
-
1:14:35
So, okay asks is it necessary to know everything and keep everything in my mind?
-
1:14:42
No, not at all, don't ever try to keep everything in your mind,
-
1:14:47
it's just not gonna work.
-
1:14:49
It really isn't, you will never ever keep everything in your mind so don't.
-
1:14:55
Don't even worry about that at all.
-
1:14:58
Okay, so this is our layout.
-
1:15:01
We wanna also handle if somebody puts some data in there, right?
-
1:15:05
So let's do, Okay,
-
1:15:14
so we want to, Put whatever is in there.
-
1:15:20
So we wanna do self.f_input.bind.
-
1:15:23
And then here, this is where we're specify
-
1:15:28
which key is going to trigger the thing.
-
1:15:33
So we're binding a key to a function.
-
1:15:38
So we'll call this at self.convert_and_update
-
1:15:51
Okay?
-
1:15:51
And we'll do the same thing here for c.
-
1:15:54
So let's make a new function here called convert_and_update.
-
1:16:00
And this is going to take an event, so we're gonna know what event comes in here.
-
1:16:06
And what we want to do here is we want to do self., for
-
1:16:11
now let's just update these variables, right?
-
1:16:14
So self.f_input_val.set(self.f_input.get)
-
1:16:27
I think that will work.
-
1:16:31
And let's do the same thing here for c.
-
1:16:37
And lets do print(self.f_input_val.get()).
-
1:16:43
And let's see what this does.
-
1:16:47
All right, so this one should be my f, I'm gonna put in 10,
-
1:16:51
I'm gonna press Enter, check it out, we got 10.0.
-
1:16:55
I'm gonna put in 50, press Enter.
-
1:16:58
I got 10.0, because I'm only printing out the f1.
-
1:17:04
So let's print this out a little bit nicer, let's print("F: {} .format,
-
1:17:11
actually, no, let's not worry about that.
-
1:17:16
And then c whoops.
-
1:17:21
And then we'll make this c, and we'll run that.
-
1:17:26
And we'll do 10 there again.
-
1:17:32
Okay, there's F10 and then here lets do 50.
-
1:17:40
And we got 10 and we got 50.
-
1:17:42
So what we should do is right here,
-
1:17:47
self.f_input_val.set(0).
-
1:17:59
So now if I do this as like 20.
-
1:18:05
But I got an empty string.
-
1:18:12
We need to set the value on each of these.
-
1:18:14
So when this runs, self.f_input,
-
1:18:24
"textvariable",
-
1:18:32
=_self.f_input_val.
-
1:18:35
And we'll do the same thing here for c.
-
1:18:41
Oops.
-
1:18:48
And then.
-
1:18:56
Yes, you do.
-
1:18:58
[BLANCK_AUDIO].
-
1:19:08
I'm being silly, there we go.
-
1:19:12
All right,, so that says 10 or 0.
-
1:19:13
If I change that to 10, we get 10 and 0.
-
1:19:16
If I change this one to 50, that comes up as 50.
-
1:19:19
All right, cool, so this is cool, this is great.
-
1:19:23
Oops I keep hitting my mic, but it looks horrible, right.
-
1:19:26
Like we wanna make it a little bigger probably we wanna align some labels,
-
1:19:31
we wanna do something, right?
-
1:19:34
I'll see if I can find the grid down here.
-
1:19:39
Images, file handlers, I'm not worried about file handlers.
-
1:19:42
Where is the grid?
-
1:19:44
Because I know there's a grid thing.
-
1:19:55
Those are books, I don't care about the books at the moment.
-
1:20:00
Dialogues, message, font, probably a thing we wanna look at.
-
1:20:05
Turtle, turtle's fun.
-
1:20:10
Figure that out later, though.
-
1:20:22
Alright, there we go, the grid method.
-
1:20:26
[LAUGH] Okay so,
-
1:20:35
That's not, that's not useful.
-
1:20:38
[LAUGH] tutorial, does this have a grid?
-
1:20:44
See we can find the grid.
-
1:20:46
There we go, the grid.
-
1:20:47
Okay so, the grid is cool because it let us define columns and
-
1:20:53
rows, which is what we want.
-
1:20:58
So let's see if we can find the Python bit, here we go, okay.
-
1:21:01
So you can see that we're building this frame.
-
1:21:04
So a frame is just something that holds something else, right?
-
1:21:07
And so inside of there we could build other frames if we want.
-
1:21:12
So, let's do,
-
1:21:19
These are our other grids, that's not quite as useful as I was hoping it was.
-
1:21:26
Okay, let's just try it, let's see what we can do.
-
1:21:30
So we want to build a grid, so
-
1:21:32
let's make a new function here which is create_grid,
-
1:21:37
or new method rather, and [COUGH] excuse me.
-
1:21:46
We didn't make any frames there.
-
1:21:50
That was right, we made our application a frame, okay.
-
1:21:53
So we're gonna make a frame so let's do,
-
1:21:58
self.content, and let's say
-
1:22:03
this is gonna be tk.ttk.Frame.
-
1:22:09
And that's gonna take root, but that's actually gonna take self.master,
-
1:22:15
because we're defining master up here.
-
1:22:18
Okay and then, we want to make, inside of that,
-
1:22:31
Let's see, where do we wanna put that?
-
1:22:38
Cuz the grid is weird, Column number,
-
1:22:50
The grid is so weird, I keep forgetting how weird the grid is.
-
1:22:59
Okay, so let's see, we make a frame, we make a frame, we make a label.
-
1:23:04
Once that's cool, we need some labels.
-
1:23:07
All right, so let's go ahead and make a label here actually.
-
1:23:10
So self.f_label = ttk.Label(),
-
1:23:23
Content, is that specifying where that is?
-
1:23:28
Yeah, yeah yeah yeah yeah, okay.
-
1:23:30
So text="Fahrenheit",
-
1:23:35
I probably got that way wrong,
-
1:23:40
[LAUGH] but that's okay!
-
1:23:44
And then we'll do this, and we'll say Celsius.
-
1:23:52
Typo in word Fahrenheit, can you fix it?
-
1:24:01
Spelling > Change to, Thank you, there, now I don't look silly.
-
1:24:09
Okay, so, [LAUGH] That's it, okay, okay okay okay, I remember how we do it now.
-
1:24:18
I think I remember how to do it, okay so content is that, we've created it.
-
1:24:24
And then what we need to do, there's our root, there's that.
-
1:24:31
Each thing gets built up inside there,
-
1:24:34
then we specify, Where each thing is, okay so let's try doing that.
-
1:24:39
So let's try doing self.content.grid,
-
1:24:45
and this is gonna be at column=0, row=0.
-
1:24:52
And I think that means we want to get rid of self.pack?
-
1:24:58
And we wanna take off, actually let's just comment that out.
-
1:25:03
Much safer just to comment things out for right now.
-
1:25:10
Okay so, what we want is, we want to have that one,
-
1:25:15
and then we wanna have a row for
-
1:25:18
where the two, Where we're gonna have a row for
-
1:25:24
a label and a thing, and a label and a thing, right, a label and an input.
-
1:25:28
So let's call this inputs, and
-
1:25:33
that will be a new Frame, which belongs to content.
-
1:25:40
And yeah, we'll do borderwidth is 5,
-
1:25:46
not [LAUGH] 50, and relief is, yeah sunken,
-
1:25:56
Okay, so that's gonna hold
-
1:26:01
the inputs, so then this input
-
1:26:07
is going to be at self.inputs.
-
1:26:20
I need to shrink that over, there we go.
-
1:26:23
That way I can see all of that, okay,
-
1:26:32
Maybe we need to have inside of that more,
-
1:26:33
maybe we need to have, Let's leave that alone for right now, okay.
-
1:26:39
So then we're gonna say self.inputs, Is at column=0,
-
1:26:45
right, it's all the way over on the left, row=0, it's all the way at the top.
-
1:26:53
And then how many columns it has in it, it's gonna have 2 columns, and
-
1:26:58
rows, it's gonna have 2 rows.
-
1:27:02
I think that's the way that works.
-
1:27:06
So that's in there, that's in there.
-
1:27:14
That's in there, and that's in there.
-
1:27:18
So now we have to say where these things are in that grid.
-
1:27:22
So self.f_label in that grid is
-
1:27:27
going to be at column=0, and row=0.
-
1:27:37
And then f_input,
-
1:27:42
Is going to be at column=1, row=0.
-
1:27:49
C_label is going to be at column=0 and row=1,
-
1:27:55
and c_input is going to be at column=1, row=1.
-
1:28:07
Ttk is not defined, okay,
-
1:28:12
import, from tkinter import ttk.
-
1:28:17
So then we'll change these over to that.
-
1:28:34
No that's not the problem, The problem
-
1:28:39
is I didn't do tk.ttk on that, or on this.
-
1:28:49
No not that, that.
-
1:28:54
Okay so there, there's an actual layer, okay.
-
1:28:57
from tkinter import ttk, so let's search for
-
1:29:04
tk.ttk, and then, That,
-
1:29:09
that, that, that.
-
1:29:20
That should be .grid, yep, yeah, okay.
-
1:29:28
And that's true, I forgot to call self.create_grid.
-
1:29:37
Content is not defined, that's also true, this should be self.content.
-
1:29:44
Sweet, so we have our box, right?
-
1:29:49
You all can see that have the box, and then we have our labels, and
-
1:29:53
our boxes here that are aligned like we wanted.
-
1:29:57
So that's pretty awesome.
-
1:30:01
That's neat, we don't have our quit button anywhere.
-
1:30:04
We should probably have a quit button.
-
1:30:07
We should probably also have a button, probably two buttons,
-
1:30:11
that say like F to C and C to F so we know which one to update.
-
1:30:16
So let's try adding those.
-
1:30:18
Also, we should change this title to Temperature Converter.
-
1:30:30
All right, so, I want to
-
1:30:34
make those able to expand.
-
1:30:39
How can I do that sticky?
-
1:30:44
Center the cell in the widget.
-
1:30:47
Position the widget in a corner of the cell by doing that.
-
1:30:51
Okay, so we wanna do some of that.
-
1:30:53
So when we're defining grid,
-
1:30:58
so I want Content should already be sticky.
-
1:31:05
But let's just make sure and say,
-
1:31:11
sticky=tk.N+tk.E+tk.S+tk.W.
-
1:31:27
And you know what? Let's actually make a thing
-
1:31:32
up here that's like STICKY_ALL.
-
1:31:42
And let's do that in here, STICKY_ALL.
-
1:31:48
Because I have a feeling we're gonna do that more often than we are anything
-
1:31:51
else, right?
-
1:31:52
So if we do that, then we can't see whether or not that's sticky or not.
-
1:31:57
But we'll get to that in a second.
-
1:31:59
Okay, so, we got that.
-
1:32:01
And then inputs,
-
1:32:02
I think that one we're gonna want to have STICKY just left and right.
-
1:32:08
So, let's do
-
1:32:13
STICKY_H =
-
1:32:17
tk.E + tk.W.
-
1:32:22
So that's this one, and we'll say sticky=STICKY_H.
-
1:32:29
Let's run that, and now we should, no.
-
1:32:35
No, what happened?
-
1:32:44
Is that on Frame maybe I need to specify something?
-
1:32:50
Tk.Frame.
-
1:33:05
All right, that would be tkinter.Frame, not tk.
-
1:33:41
That's kind of weird, that it's obviously something I can
-
1:33:46
use as I'm specifying tk.Frame right there.
-
1:33:51
But that's not showing up.
-
1:33:55
That's really weird.
-
1:34:00
Columnspan, okay.
-
1:34:01
You can grab multiple cells of a row and merge into one.
-
1:34:10
Column number where you want the widget gridded counting from zero.
-
1:34:14
Occupies one cell in the grid.
-
1:34:19
You know what, let's take that out.
-
1:34:28
And let's just leave it like that and see what it does.
-
1:34:37
That didn't do it either.
-
1:34:45
Register w, so the grid, has a child of some widget, w2, used in_=w2.
-
1:34:52
The new parent must be a descendatnt of the parent widget used when w was created,
-
1:34:57
okay.
-
1:35:01
Maybe that doesn't work for grid bits, so,
-
1:35:17
I don't think it would be in_=self.content.
-
1:35:20
That doesn't make sense.
-
1:35:25
Watch, that's gonna work.
-
1:35:27
No, that didn't work, okay.
-
1:35:30
Hi, Simeon, well maybe you're not done entering it yet, right?
-
1:35:36
Like you're asking, why not automatically update it?
-
1:35:38
Maybe you're not done.
-
1:35:40
And vine vine, WordPress is created in PHP.
-
1:35:46
So that wasn't what I wanted.
-
1:35:50
STICKY_H, yeah, E + W.
-
1:35:53
And then we should have a STICKY_V, which is N + S.
-
1:36:16
Okay, well, we won't worry about that just yet.
-
1:36:19
So let's get the buttons in there.
-
1:36:24
So, now I want to make a new one, which is self.input, no, not input, buttons.
-
1:36:32
Which is gonna be a frame, which is also gonna be in self.content.
-
1:36:38
No border or anything like that, it's just gonna live there.
-
1:36:41
And self.buttons.grid is gonna be in column 1 but row 0.
-
1:36:49
And sticky will be STICKY_H.
-
1:36:55
I don't think this is gonna quite do what I want, but let's find out.
-
1:36:58
Okay, so we got those packed.
-
1:37:01
I'm gonna turn these two things off because we're gonna
-
1:37:04
do that in a minute when they click the button.
-
1:37:06
But I'm not gonna do it just yet.
-
1:37:08
So first let's do
-
1:37:12
self.f_to_c = tk.Button.
-
1:37:19
And the master is going to be
-
1:37:24
That should be in self.buttons.
-
1:37:30
Text will be "F -> C" and
-
1:37:35
command will equal
-
1:37:41
convert_f_to_c.
-
1:37:47
Yep, that's fine.
-
1:37:48
And then we're gonna do C, -> F.
-
1:38:00
And that will be convert_c_to_f.
-
1:38:08
Christian, you can use pack after configuring the grid.
-
1:38:11
But you often don't want to just because, Where the grid,
-
1:38:20
The grid and the pack often fight each other.
-
1:38:24
So lots of times you don't wanna put them both in there.
-
1:38:28
So self.f_to_c.grid(column,
-
1:38:35
its gonna be 0, row is gonna be 0.
-
1:38:42
And c_to_f is going to be column 0, but row 1.
-
1:38:53
Yep, and I don't have either of those named.
-
1:38:55
So convert_f_to_c is gonna take an event and we're just gonna pass.
-
1:39:03
And then convert_c_to_f
-
1:39:08
is gonna take an event.
-
1:39:12
And it's just going to pass as well for right now.
-
1:39:21
Self, self,
-
1:39:35
Typos galore today.
-
1:39:38
All right, so, let's see how these two things play together.
-
1:39:42
So, they just hang out there.
-
1:39:45
That's cool, that's fine.
-
1:39:47
Neither of them do anything.
-
1:39:51
That's okay.
-
1:39:53
So, we will Actually, yeah, I guess buttons probably don't take an event.
-
1:40:00
We know what they're doing.
-
1:40:02
Okay so,
-
1:40:02
let's see if we can make these two things stick where we want them to stick.
-
1:40:10
So I want, I want this
-
1:40:16
one just to be tk.N+tk.W.
-
1:40:22
And I want this one to be tk.N+tk.E, right?
-
1:40:27
Cuz I want them to do their thing.
-
1:40:34
What is up with this?
-
1:40:38
This grid should be doing what I'm telling it to do.
-
1:40:43
Why is this grid not stretching things out?
-
1:40:59
Yeah, no I know Christian, a lot of things do need pack but,
-
1:41:13
And we can also do this as a string.
-
1:41:15
Let's try that.
-
1:41:18
So we want this to be north and east.
-
1:41:22
And we want this to be, there we go.
-
1:41:27
String of north and west.
-
1:41:34
Okay, that's not doing it.
-
1:41:35
What if we were to put in north, east, and west in that?
-
1:41:41
All right, that makes no sense.
-
1:41:43
And, w on that one.
-
1:41:49
Right, that makes no sense.
-
1:41:51
Here we go, resize.
-
1:41:56
As a weight, right.
-
1:41:58
Positive weight to the columns we'd like to expand.
-
1:42:00
This is done using the columnconfigure and rowconfigure methods of grid.
-
1:42:03
If two columns have the same weight, they'll expand at the same rate.
-
1:42:06
One has 3, take a minsize grid, so that's why it's a minimum size.
-
1:42:12
Okay, so let's look down here and see what we've got.
-
1:42:17
So then we've got padding, and then we've got weights, all right let's try that out.
-
1:42:22
So self.inputs is obviously one of our columns.
-
1:42:26
So let's say, columnconfigure,
-
1:42:33
on that be 0 column.
-
1:42:40
Weight=3.
-
1:42:44
No, not that one.
-
1:42:46
We want content, I think this is what we want.
-
1:42:50
Okay, columnconfigure,
-
1:42:54
the 0 one is going to change at 1 and
-
1:42:59
the 1 is also going to change at 1.
-
1:43:04
Didn't do what I wanted.
-
1:43:05
Thanks for not doing what I wanted.
-
1:43:08
[LAUGH] Hey DarkDev, you know it's always Python.
-
1:43:16
It's always Python for me, right?
-
1:43:19
Yeah, Simeon it's this rowconfigure, columnconfigure,
-
1:43:23
that's what I'm trying to get going here.
-
1:43:36
That's what weird is it's not,
-
1:43:46
Column span and row span, so that's like how many columns you want to cover.
-
1:43:51
All right, which by default that should be 1.
-
1:44:02
Let's just search for grid.
-
1:44:05
No?
-
1:44:14
Whatever.
-
1:44:16
Yeah, so, those would just be 1 as far as I understand it.
-
1:44:23
By defaults.
-
1:44:25
Tcl.
-
1:44:38
There's a lot of Tcl stuff.
-
1:44:39
Let's not even get into that Tcl stuff just yet.
-
1:44:43
Okay, column span is one cell in the grid, okay.
-
1:44:49
Grab multiple cells of a row and merge them into one larger cell by setting
-
1:44:51
the columnspan option to the number of cells.
-
1:44:54
Okay, that makes sense.
-
1:44:59
In a cell that spans columns 2, 3, and 4, uh-huh,
-
1:45:04
2, 3, and 4, yep, row 0, okay.
-
1:45:10
That makes sense.
-
1:45:11
Let's add a little bit of padding to this one.
-
1:45:13
This one is feeling a little horrible.
-
1:45:15
So ipadx=5, ipady=5,
-
1:45:29
That goes into grid, Not into there.
-
1:45:33
ipadx=5, ipady=5.
-
1:45:41
There we go. We get a little bit more room.
-
1:45:44
That one that looks funny, it's also the same thing on that one.
-
1:45:56
It still looks a little funny.
-
1:46:13
We'll take off the padding.
-
1:46:17
The sticky is so weird, why is the sticky not working?
-
1:46:42
It's because this one isn't sticky?
-
1:46:47
Oops.
-
1:47:05
That's not it.
-
1:47:43
Okay, that looks a little nicer.
-
1:47:45
Set that into here.
-
1:47:57
Still not resizing.
-
1:48:08
Okay, you know what?
-
1:48:09
It doesn't matter.
-
1:48:10
It honestly doesn´t matter.
-
1:48:12
Let's just make these buttons work.
-
1:48:16
Okay, so let's take those off.
-
1:48:19
I'm not gonna worry about those.
-
1:48:23
Let's put all of the f stuff together, and then all of the c stuff together.
-
1:48:32
Okay so,
-
1:48:39
Convert f to c.
-
1:48:48
Formula, all right, the temperature T in degrees Celsius is equal to
-
1:48:53
the temperature T in degrees Fahrenheit minus 32, times 5 to the ninth.
-
1:48:58
Okay, you know what, let's cheat and let's do Python.
-
1:49:11
All right, cool.
-
1:49:13
So, we're gonna take f.
-
1:49:16
So f = self.f_input.get.
-
1:49:24
And were gonna say that c = f- 32.
-
1:49:32
And we have to do that first.
-
1:49:35
And were gonna multiply that * 5/9.
-
1:49:40
And then we're going to say
-
1:49:44
self.c_input val.set to c.
-
1:49:50
And self.c_input
-
1:49:56
textvariable
-
1:50:07
Let's make a new function here, _update.
-
1:50:19
Okay cool, so we do that, we do that, and then we do self._update.
-
1:50:30
And then down here, self._update.
-
1:50:35
So, That gives us the F2C,
-
1:50:40
let's try that one, so let's say that 212 degrees Fahrenheit.
-
1:50:53
For string and int.
-
1:51:07
That should be a float that comes out of that, I'm not sure why it's not.
-
1:51:13
Sweet, so that looks like that works, right?
-
1:51:19
Okay, so now let's do the opposite of this, so
-
1:51:25
c = float(self.c_input.get()),
-
1:51:30
c is equal to, or not c, f,
-
1:51:36
= (c * 9/5) + 32.
-
1:51:45
And then self.f_input_val.set(f),
-
1:51:51
and self._update.
-
1:51:56
And if I say my Celsius is 100 degrees, and
-
1:51:59
I do c to f, that comes out as 212, and vice-versa, cool.
-
1:52:04
So if it was 32 degrees Celsius, that would be almost 90 degrees Fahrenheit.
-
1:52:08
And if it's 102 degrees Fahrenheit,
-
1:52:11
that'd be 38 point [SOUND] degrees Celsius, cool.
-
1:52:15
So we've got an app that works, right?
-
1:52:20
[COUGH] Excuse me.
-
1:52:25
Mm, all right, christian, you got something here, you said Wiki,
-
1:52:32
tcl tk, 1051.
-
1:52:54
Set height of the frame to 1.
-
1:53:03
Can I do that?
-
1:53:04
[COUGH] Sorry.
-
1:53:11
Here's this one, height = 1.
-
1:53:37
Hm, well, you know what?
-
1:53:38
I'm not gonna worry about it for now.
-
1:53:41
It works fine as it is, and we're coming up on the 2 o'clock, or
-
1:53:45
the 2 o'clock, the 2 hour mark.
-
1:53:48
So I think I'm gonna stop messing with stuff today.
-
1:53:53
[COUGH] Excuse me, and we'll do questions or comments, or anything like that.
-
1:53:58
So if you all have any questions you gotta few minutes to get them in.
-
1:54:01
And then I will answer any and all that I can.
-
1:54:06
DarkDev asks if I've been making games, no, I [LAUGH] haven't!
-
1:54:12
Actually I've been having a really horrible time trying to get Rust and
-
1:54:18
SDL working together, I've got to do some more on that today.
-
1:54:24
The plan is still to do the the Ludum Dare next week, but
-
1:54:28
we'll see, we'll see if the Ludum Dare works or not.
-
1:54:32
I may end up not being able to do it,
-
1:54:38
but I think I will be able to it, I think I'll be good, and able to get in there.
-
1:54:43
But I haven't been making any games yet, so,
-
1:54:49
I don't know how that'll work, I really don't.
-
1:54:54
[LAUGH] Wish me luck on,
-
1:55:01
On getting the Ludum Dare to even work, and getting into it.
-
1:55:06
I think I'll be able to, but we'll find out.
-
1:55:10
[COUGH] This cold is just, it will not go away, it's been very annoying.
-
1:55:17
So yeah, anybody have any questions, comments,
-
1:55:22
concerns, critiques, criticisms,
-
1:55:26
other words that start with the, cuh, sound?
-
1:55:32
What's going on with everybody?
-
1:55:37
No, I dropped 0.1% of my frames, this is horrible!
-
1:55:46
I also have an idea of doing a stream here in a week or two.
-
1:55:50
I wanna try and do the Mandelbrot set, or
-
1:55:55
drawing the Mandelbrot set, using Python.
-
1:56:00
But, a, I gotta figure out my math better, and
-
1:56:05
b, I have to figure out how I'm gonna draw it.
-
1:56:10
Seems like Turtle might work, but it also seems like I could probably
-
1:56:12
do it with like Pillow and just setting pixels, so yeah.
-
1:56:16
James Scott, you're new to the stream, well, welcome, glad to have you here.
-
1:56:21
Did I learn and get a job through Treehouse?
-
1:56:23
No, I teach for Treehouse, I am the Treehouse Python teacher.
-
1:56:28
So you got to Treehouse, and you go, you're like, I wanna learn Python.
-
1:56:32
You're gonna see a whole lot of this, and hear a lot of this voice,
-
1:56:36
as you're learning Python from [LAUGH] Treehouse.
-
1:56:40
No, I taught myself to program years and years and years ago,
-
1:56:45
I've been a programmer for a long time,
-
1:56:48
and, Yeah, and I got tired of programming so
-
1:56:53
I started teaching, and I really like teaching a lot better.
-
1:56:57
DarkDev, no game ever after 20 years?
-
1:56:59
Well no yeah, I mean I've made games, or I've played around with making games.
-
1:57:05
But I haven't been making a game lately, which is what I thought you meant.
-
1:57:09
I thought you meant, have you been making a game in the last few weeks,
-
1:57:14
no I haven't.
-
1:57:15
Have I made a game ever in my life?
-
1:57:18
Yes, sort of.
-
1:57:20
Gr33n Wizard, how old is that beard?
-
1:57:23
About four years old, four and a half, maybe.
-
1:57:29
Yeah, I have a child that's never really seen me without one, [LAUGH] so it's old,
-
1:57:33
it's older than the child.
-
1:57:34
Christian, is this this the preferred toolkit used in the Python world,
-
1:57:38
because once I wrote Swing app using Python, very slow [LAUGH] by the way.
-
1:57:43
Tkinter is not necessarily the preferred GUI toolkit in the Python world.
-
1:57:48
There are others that are definitely better,
-
1:57:50
depending on the situation that you're in, right?
-
1:57:53
If you're building something for Linux,
-
1:57:56
you might be better off looking at PyQT or PyGTK.
-
1:58:00
If you're building something just for Windows,
-
1:58:03
then you're probably better off looking at PyQT.
-
1:58:07
Or maybe something like Kivy, or there's another one that starts with an s, Skulpt?
-
1:58:13
Skulpt, I think that's it, like S-K-U-L-P-T, something like that.
-
1:58:17
If you're building something for Mac, there are some other libraries,
-
1:58:21
I can't remember what they are at the moment.
-
1:58:25
But yeah, there's a lot of different toolkits,
-
1:58:29
there aren't any amazing toolkits for Python.
-
1:58:35
There are a lot of just, these are ok, these are toolkits, and they work and
-
1:58:40
they do a thing, but they're not necessarily great toolkits.
-
1:58:48
Typically if you're gonna do GUI programming,
-
1:58:49
you probably want to do something that is more of a native thing, anyway, right?
-
1:58:55
So if you're gonna go build apps for Mac, you probably wanna go and
-
1:58:59
learn Objective-C or Swift.
-
1:59:00
If you're gonna build apps for Windows,
-
1:59:03
you'll probably wanna go learn C#, you're gonna get just better results.
-
1:59:08
If you need to learn C#, talk to the DarkDev,
-
1:59:12
he's apparently a master C#-er, so he's a C-sharpener.
-
1:59:17
That's a horrible joke, anyway [LAUGH] so,
-
1:59:20
that's two hours, I've got stuff I gotta do, y'all have stuff you gotta do.
-
1:59:26
So I think we're going to call it here, but I will see all of you next week.
-
1:59:30
Hopefully we will not encounter all of the problems that we encountered this time.
-
1:59:37
We'll try something a bit more solid, decided on, for next week.
-
1:59:42
But thank you all for joining me, if you wanna learn to program,
-
1:59:45
you wanna learn how to build stuff for the web, go check out Treehouse.
-
1:59:49
We are teamtreehouse.com,
-
1:59:51
and we will do our best to teach you all sorts of cool stuff.
-
1:59:56
So, until next week, thank you all for tuning in, and I'll see you later.
You need to sign up for Treehouse in order to download course files.
Sign up