Latest / Talk Python To Me / #140: Level up your Python with #100DaysOfCode challenge
Transcript
- 0:00How do you learn libraries or even parts of Python itself that you don't have actual work projects to try them out on?
- 0:05Whether that's SQLAlchemy, Slack bots, or Map APIs, actually building projects, small and large, with them is really the only way to gain true competency.
- 0:14Well, you might try one of the 100 days of Python code challenges that have been going around.
- 0:21This week, you'll meet Bob Belderbos and Julian Saccaria, who created PyBytes.
- 0:26They've done a few 100 days of code challenges and are here to share their experience and even some concrete examples.
- 0:33This is Talk Python To Me, episode 140, recorded November 28, 2017.
- 0:52Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.
- 0:59This is your host, Michael Kennedy. Follow me on Twitter, where I'm @mkennedy.
- 1:03Keep up with the show and listen to past episodes at talkpython.fm, and follow the show on Twitter via at Talk Python.
- 1:10Talk Python To Me is partially supported by our training courses.
- 1:14Have you heard about the 100 days of code challenge?
- 1:16It's a challenge where you write code for an hour a day for 100 days.
- 1:20It's helped many developers finally master programming.
- 1:24But it can be hard to know what to study or have resources to focus on.
- 1:28That's why we wrote not one, but two 100 days of code courses.
- 1:33100 days of code in Python, which covers mostly pure Python.
- 1:37And 100 days of web in Python, which covers a whole spectrum of web frameworks and concepts.
- 1:43If you've been thinking about taking the 100 days of code challenge, be sure to visit training.talkpython.fm and check out our courses.
- 1:50They are the 100 days of projects and lessons with a tidy bow on top just for you.
- 1:55Bob, Julian, welcome to Talk Python.
- 1:58Hey, Mike. Thanks for having us.
- 2:00An honor.
- 2:01It's great to have you here and see you at least on Skype.
- 2:03Bob, we had such a great time at PyCon.
- 2:06Indeed. It was very nice meeting you.
- 2:08Yeah, it was great to hang out.
- 2:09And I think that was really my favorite part of PyCon is just meeting all the people and the experiences outside the talks in the conference rooms.
- 2:16But it was a good time.
- 2:18And Julian, next year maybe you can make it.
- 2:20Who knows?
- 2:20Oh, man. Totally jealous.
- 2:22It is a very long way from Australia.
- 2:24I'm going to try for 2018.
- 2:26Oh, that's awesome.
- 2:27Yeah, I've done that flight from Sydney.
- 2:28It's a commitment.
- 2:29It's not pleasant.
- 2:30Let's just say that.
- 2:31No, but look, if you're going to Australia, you come from my direction to yours.
- 2:36It's a wonderful place to visit.
- 2:37So maybe I'll get down there someday.
- 2:39So we're going to talk about code challenges.
- 2:42You know, Twitter has been afire with this concept of 100 days of code.
- 2:47Basically, people who are learning something new or pushing their boundaries in some way.
- 2:52Like, I'm going to do this for 100 days.
- 2:55And I'm going to commit publicly to doing it.
- 2:57And, you know, sort of testify to social media, if that is a thing that I've done my days at work.
- 3:02Right.
- 3:03And so we're going to have a good sort of retrospective on this one that you did and maybe talk about another one that you guys are doing as well.
- 3:11Before we get there, though, let's start with your story.
- 3:15How did you get into programming in Python?
- 3:16Julian, go first.
- 3:17All right.
- 3:18So it's actually kind of funny.
- 3:20I'm really, if you're familiar with PyBytes, I'm the relative newbie compared to Bob.
- 3:25So I actually started with C++ in high school.
- 3:29But Python-wise, I don't actually work with Python every day.
- 3:32It's not what I do for a job, which has made it incredibly difficult.
- 3:36Right.
- 3:37It was actually Bob who pushed me.
- 3:38So I was trying to calculate some overtime when I worked in the field for Oracle.
- 3:44And, yeah, he said, why don't you create a Python app to track that?
- 3:48And that was it.
- 3:49As soon as I started doing it, bang, I was like, this is so cool.
- 3:53This is so much easier than smart pointers in C++ or, you know, whatever.
- 3:58Exactly.
- 3:59I'm like, well, now I don't have to log in and use the Oracle tool.
- 4:02I can use my own.
- 4:02Beautiful.
- 4:03Yeah, it was great.
- 4:04And then from that, it's just one thing after another and then PyBytes.
- 4:08Yeah, awesome.
- 4:08And what do you do day to day for work?
- 4:11Do you work at Oracle still?
- 4:12No, no.
- 4:13So I resigned about a year and a half ago and I now work for Amazon Web Services.
- 4:18Oh, exciting.
- 4:19What do you do there?
- 4:20It's a bit hush-hush, but I work in one of the data centers.
- 4:23So it's a lot of fun.
- 4:25So if anything goes down, it's probably me.
- 4:28No, I'm just kidding.
- 4:28We'll put your Twitter account on this page.
- 4:33And as soon as AWS, like Asia goes down, you're going to just hear about it.
- 4:37Yeah, sure.
- 4:38I'll get an email from you as well.
- 4:39Yeah, that's right.
- 4:40Nice.
- 4:42All right, Bob, how about yourself?
- 4:43I started programming about 10 years ago.
- 4:46I was working in a financial department and we had to close the month every month.
- 4:53And tasks got a bit boring.
- 4:54So I started to use Excel and macros to automate the stuff.
- 4:58At the same time, I discovered web design and making web pages, which I was very passionate about.
- 5:04So I self-taught programming, went back into Sun and later Oracle as a support engineer,
- 5:10started to build web tools for the engineers to solve their cases more rapidly.
- 5:17Well, I was doing that in Bash.
- 5:18Give us an example of like a tool you might make and the problem that it solves.
- 5:22An example of a tool?
- 5:23Yeah, yeah.
- 5:23Like what kind of tools would you make?
- 5:25Like what kind of problems and how would you help people solve them?
- 5:27Yeah, that was cool because there was one day in the chat room, somebody said like,
- 5:32well, we're getting all these diagnostic bundles from servers and we don't have any tool to do diagnostic on them.
- 5:38It's like these lucky moments when you see an opportunity and you can build something big.
- 5:43So I started to develop a tool to diagnose these bundles and have a web GUI for engineers to help solve the issues.
- 5:53And that tool became pretty big with hundreds of engineers using it.
- 5:57And that got me into it.
- 5:59And it's still in Python?
- 6:00No, that wasn't PHP.
- 6:02And later work then was in Perl.
- 6:05And that got a bit of a mess.
- 6:07So in 2012, I looked at other options, stumbled upon Python, found it very clean and nice.
- 6:16And I never looked back.
- 6:18So I've been using it for five years now.
- 6:21If you look at the graphs of the popularity of Python and the growth of Python,
- 6:25there's an amazing article from Stack Overflow called The Incredible Growth of Python.
- 6:30And that's super amazing.
- 6:31But if you look at where the graph turns sharply up, that's in 2012.
- 6:35So you're partly to blame or to credit for that.
- 6:38That's awesome.
- 6:39Yeah, man.
- 6:41So you just like languages with Ps, right?
- 6:43PHP, Perl, Python?
- 6:45I do like JavaScript a little bit as well.
- 6:48Maybe we can put a silent P in there.
- 6:50Speaking of Ps, let's talk about PyBytes.
- 6:53This is so similar to the name of my other podcast.
- 6:57That was so funny.
- 6:59There's all these weird coincidences, right?
- 7:00There were no Python podcasts.
- 7:01And then I released this one like days before podcast init comes out.
- 7:05And they're like, we're the first one.
- 7:07Wait, no, we're not.
- 7:08Why?
- 7:08And then, you know, we both released like a similar thing.
- 7:11I feel like it was just about the same time, right?
- 7:13It was around December last year, I think, right?
- 7:16Exactly.
- 7:17I think we were in November.
- 7:18It was just like crazy.
- 7:20So P-Y-B-I-T dot E-S, right?
- 7:23Yep.
- 7:24It reveals one of the locations, Spain.
- 7:28Exactly.
- 7:28That's where you are.
- 7:29Yeah.
- 7:30So you guys tell everyone about it.
- 7:32It's a pretty cool resource.
- 7:33So PyBytes is a blog where pretty much the bare minimum, we share our passion and love for Python.
- 7:39That's it.
- 7:40It started because of that.
- 7:42Bob and I, we always struggled to work on projects together because of the sheer time difference, time zones, different jobs now.
- 7:49And it was just ridiculous.
- 7:51So we eventually just bit the bullet and said, you know what?
- 7:53Why don't we start a blog together on Python?
- 7:55So he knew a lot.
- 7:57I didn't know a huge amount.
- 7:58And we felt that that gap between our knowledge levels would be an awesome concept for a blog.
- 8:05He could do the more complex stuff and I could do the really beginner stuff as I'm learning it.
- 8:10So as Bob would be learning some crazy complex concept, he would write these amazing articles on it and I'd be scratching my head going, what the hell are you talking about?
- 8:21And then I'd take something that was quite simple to Bob and I would write that in super layman's terms so that anyone could read it and understand it.
- 8:31And we had this sort of double whammy approach.
- 8:33I think that's really, yeah, that's a super cool idea because I think there's huge value in people who are new to a particular technology like you described yourself, talking about their experiences, explaining what they're learning.
- 8:45And there's so many people who are learning what you're learning that they're not necessarily looking for the high end expert analysis of meta classes.
- 8:53They want to know how to write a function with default values or, you know, something like this, right?
- 8:57And so that's super helpful.
- 8:58But then on the other hand, a lot of times that comes up a little bit short and not actually having the right depth, the really the best answer.
- 9:07And it feels like you guys could team up on that.
- 9:10Did it work that way, Bob?
- 9:11Yes.
- 9:11And I think it's a nice dynamic between beginner level and Julian making stuff really accessible.
- 9:19And me sometimes tackle maybe a bit more advanced topic.
- 9:23So, yeah, I think it's a great combination.
- 9:25And, yeah, funnily, yesterday we did a code challenge and we made a new one.
- 9:31And Julian sent me the beginning and I then tweaked it.
- 9:35And he said, well, that's way advanced.
- 9:37You do like sort with lambda.
- 9:39And that's cool because for some folks, some of the audience do need that more advanced level.
- 9:45But some of the folks are still with for loops and variables.
- 9:48And, yeah, you really have to take a step back.
- 9:52And I think Julian is great at that.
- 9:53He made some very accessible articles like on what is a class or how to write a for loop.
- 9:59And you notice that a lot of beginning Pythonistas need that.
- 10:03That's for sure.
- 10:04It's really easy to sort of zoom past the introductory stuff and get to like the excited internals.
- 10:10Like, here, let's disassemble this and look at the bytecode and see what it's doing.
- 10:14It's like, no, maybe not so much.
- 10:17And we got to take a step back.
- 10:19Cool.
- 10:20So how did you guys meet up?
- 10:22You guys are let's talk about some crazy time zone shifting.
- 10:25Like the world we live in is so amazing.
- 10:27So, Bob, what time is it?
- 10:2811 p.m.
- 10:2911.15 almost.
- 10:31Yeah.
- 10:31Julian, what time is it?
- 10:33It's 9.15 a.m. on Wednesday.
- 10:35Oh, you guys are all wrong.
- 10:36It's 2 in the afternoon on Tuesday.
- 10:38And you are in the future.
- 10:39We made it.
- 10:40So that's pretty.
- 10:41Yeah, exactly.
- 10:42Yes, we got at least 12 more hours.
- 10:44So how did you guys meet up across all this time and space?
- 10:47So we actually haven't met, believe it or not.
- 10:51Probably think I'm lying, but we haven't met in person.
- 10:53Back in Sun Microsystems where we both worked, Bob actually, out of the blue,
- 10:58randomly wanted to use some machines that I was looking after.
- 11:02And we had this conversation and we just, I guess, ended up emailing back and forth.
- 11:07And now we're practically married.
- 11:10It's crazy.
- 11:11Yeah.
- 11:12You guys have like deadlines every single day.
- 11:15You have to agree on code and whatnot, right?
- 11:17Yeah.
- 11:18Daily on the phone.
- 11:19That's awesome.
- 11:19So a lot of Skype or other VoIP stuff and GitHub and things like that.
- 11:25Yeah.
- 11:25WhatsApp works well for talking.
- 11:28And we use Slack also with some more folks of our community.
- 11:33And yeah, GitHub for coding.
- 11:36Yeah.
- 11:36We use a lot of tools.
- 11:37It's a great time to live in.
- 11:39It totally is.
- 11:39For Slack, do you guys have like a PyBytes community?
- 11:43Yes.
- 11:43That people can join?
- 11:44Yes.
- 11:45All right.
- 11:45Tell us about that.
- 11:46So that came around code challenges, which we will discuss in a bit.
- 11:51We started to ask people to join Slack to ask questions and share their experiences on the code challenges.
- 11:58And yeah, it's a great asset to build a community and get inputs and help people.
- 12:06Yeah.
- 12:07I think that's really nice.
- 12:08So we can put a link to that in the show notes if people want to join up.
- 12:11Yeah.
- 12:11It'd be cool.
- 12:12It's actually really cool because we invited people as they were doing pull requests and the challenges.
- 12:18And they're the most dedicated people, right?
- 12:20And so we're bringing them in and you get one or two people every few days.
- 12:24And now we have this community in there where we sort of back away sometimes.
- 12:28And these guys and girls, they just, they help each other.
- 12:31They answer their own questions and they have these conversations.
- 12:33We'll come back.
- 12:34I'll be at work all day and my watch is going nuts with hundreds of messages coming through.
- 12:38And I'm thinking, what am I missing out on?
- 12:40What's happening?
- 12:41Yeah.
- 12:41I got to take a lunch break and go see what's going on.
- 12:43Nice.
- 12:44That's really awesome.
- 12:45I mean, I have a Gitter channel for the podcast and a lot of people drop in there and it's similar.
- 12:51There's probably more people in your channel because I don't talk about it very much, but
- 12:54still it's great when people get in there and share ideas and help each other.
- 12:57Yeah, totally.
- 12:58All right.
- 12:58It's code challenge.
- 12:59So a hundred days of code.
- 13:00Bob, tell us what the general idea of this is.
- 13:04I have to get his name right.
- 13:05I think it was Alex Calloway who invented the challenge for JavaScript and promoting coding
- 13:11in general.
- 13:12It's about a hundred days in a row.
- 13:15Share your coding, share what you're doing, whatever it is.
- 13:18Do an hour a day and be responsible.
- 13:21Do a tweet out what you did.
- 13:23So you see a lot of tweets with a hashtag, a hundred days of code, and people share scripts
- 13:28or if they did a tutorial or whatever they did, but it's one hour a day.
- 13:32And we gave it a little twist of do actually a script a day, which we shot ourselves a little
- 13:37bit in the foot there.
- 13:38Tell us what happened.
- 13:41Is it like a little more than an hour or what happened?
- 13:43A lot of scripts were pretty basic and yeah, can use some refactoring and were within the
- 13:47hour, but sometimes it does not because typically happens.
- 13:50You start to build something cool and you really want to tweak it.
- 13:53And yeah, it can be more.
- 13:55But on the flip side, and we will go into a couple of scripts shortly.
- 13:59Yeah, we were picking our favorites for the show and we went through the logs and it's like
- 14:06a couple of months ago now.
- 14:07And we were like, did we do all this coding?
- 14:09It was like 5,000 lines of code in a hundred days.
- 14:12Well, between the two of us.
- 14:14So yeah, even and uneven days, but still we did so much.
- 14:18That was really cool.
- 14:19Julian, do you feel like you said you were a little newer at Python?
- 14:22Do you feel like this gave you some experience with Python in ways that maybe projects you're
- 14:27working on wouldn't?
- 14:28Oh, totally.
- 14:28Well, first of all, it absolutely destroyed me in a good way.
- 14:32It was just insane, right?
- 14:34We were coding every day as it was for PyBytes.
- 14:36So to suddenly say, well, we can do a hundred days.
- 14:40It was almost, well, we're already doing it.
- 14:43So what's the point?
- 14:44So that's when we started, said, well, what if we made a script?
- 14:47And that just took me from one level to maybe five levels above, you know, because I was
- 14:54forced to not only learn something.
- 14:56So it's not just watching a video or reading a doc or something.
- 14:59It was learn it, apply it, make it functional and have it actually do something that you
- 15:04can then share out.
- 15:05And someone can, you know, clone that from GitHub and have a running script that does something.
- 15:11That's really awesome.
- 15:11So you kind of put a little twist on it and just not just, I wrote some code.
- 15:16I have a code streak for a hundred days or whatever you want to call it.
- 15:20It's, I created 100 working little baby applications in a hundred days, right?
- 15:25And that was nuts.
- 15:26So we'll talk about the details of them in a minute.
- 15:29But Bob, can you just touch on like some of the things you got to play with?
- 15:32Like, did you get to play with a SQLAlchemy or TinyDB or, you know, things like this?
- 15:37Yeah.
- 15:38Oh, goodness.
- 15:38Yeah.
- 15:39SQLAlchemy was there.
- 15:40We will have some examples shortly.
- 15:44But we did some stats and I think we actually used exactly 100 modules, which was like a
- 15:49weird coincidence, 100 days, 100 modules.
- 15:52And I think like 40% or so was from PyPI.
- 15:55So it was a lot of external stuff as well.
- 15:57We discovered maps, plot cities on maps and a lot of APIs, web development, all kinds of
- 16:04stuff.
- 16:05And, you know, we have a lot of snippets there now, so we can go back and there's tools we
- 16:09use till this day.
- 16:11There were foundations in there with Twilio API that led to a guest post for the Twilio
- 16:15blog.
- 16:15There are Slack bots in there we use on our Slack today.
- 16:19Twitter automation we run today.
- 16:21It's pretty cool.
- 16:23Yeah, that's really, really awesome, actually.
- 16:25I feel like you could get a bunch of ideas of like almost products or things that you could
- 16:31create if you were willing to like put a few months into one of them, right?
- 16:34Totally.
- 16:35Exactly.
- 16:36And it's not about perfectionism.
- 16:38It's about doing these quick prototypes.
- 16:41Just get coding.
- 16:42You know, I mean, if you think about having the perfect script, you don't get it.
- 16:47You're not getting to do it.
- 16:49Yeah.
- 16:49I've known a lot of people who are in some people who are in programming who spend too much
- 16:54time worrying about getting things just right and not just going, I'm going to write this.
- 16:58And if I have to, I'll refactor it.
- 17:00And if like it's the worst case scenario, I'll just rewrite it knowing a lot more than I did
- 17:03the first time.
- 17:04You know, I feel like some people kind of get frozen during the headlights for big projects
- 17:09and just not really wanting to start being afraid of going the wrong direction.
- 17:14This portion of Talk Python To Me has been brought to you by Rollbar.
- 17:17One of the frustrating things about being a developer is dealing with errors.
- 17:21Ugh.
- 17:22Relying on users to report errors, digging through log files, trying to debug issues, or getting
- 17:27millions of alerts just flooding your inbox and ruining your day.
- 17:30With Rollbar's full stack error monitoring, you get the context, insight, and control you
- 17:35need to find and fix bugs faster.
- 17:37Adding Rollbar to your Python app is as easy as pip install Rollbar.
- 17:41You can start tracking production errors and deployments in eight minutes or less.
- 17:45Are you considering self-hosting tools for security or compliance reasons?
- 17:49Then you should really check out Rollbar's compliant SaaS option.
- 17:53Get advanced security features and meet compliance without the hassle of self-hosting, including
- 17:58HIPAA, ISO 27001, Privacy Shield, and more.
- 18:02They'd love to give you a demo.
- 18:04Give Rollbar a try today.
- 18:05Go to talkpython.fm/Rollbar and check them out.
- 18:10Julian, I guess this probably helps you just learn to just like, okay, you have to write.
- 18:14It is 11 o'clock at night.
- 18:15I have one hour left.
- 18:17I have to write, yeah?
- 18:18Yeah, that was it.
- 18:19It wasn't sit there and plan it and storyboard it or something.
- 18:22It was just, okay, what's the first thing we need for this app?
- 18:25Okay, it needs to output this data.
- 18:26Just write your prints.
- 18:28Write your for loops.
- 18:29Create your databases.
- 18:31And it wasn't perfect.
- 18:32It was tough.
- 18:33You know, there were some nights we'd be up till, you know, one in the morning with waking
- 18:37up at 530 because I have kids.
- 18:39And you'd be a wreck.
- 18:41And the only positive, the light at the end of the tunnel was seeing that countdown to the
- 18:45end.
- 18:45And knowing that you had a gap in between.
- 18:49So you could, you almost had two days to write the script, but you were writing across both
- 18:53days.
- 18:53And it was just...
- 18:56The other good thing is we probably spent, not spent, we probably save a couple of months
- 19:01of Netflix because I probably canceled it.
- 19:03Yeah, I was behind on all my Marvel TV.
- 19:07Yeah.
- 19:08Yeah, I sort of view programming as my gaming.
- 19:10Like I used to play things like Counter-Strike and games and whatnot.
- 19:13And now if I have an extra two hours, I'm like, oh, what feature can I add to my like
- 19:18training website?
- 19:19Or what other kind of thing could I create?
- 19:21Like, I bet I can do that in two hours, you know, and it becomes kind of a game as well.
- 19:24It's becoming like watching series.
- 19:27It's kind of relaxing.
- 19:28And yeah, the more you build, the more projects you have and the more features or stuff you
- 19:33want to add or fix.
- 19:34So yeah, it's kind of a lost game.
- 19:37For sure.
- 19:39All right.
- 19:39So let's talk about some of these particular challenges.
- 19:43You guys did 100 days of code.
- 19:45So 100 scripts, as you described it.
- 19:47And I asked you to pick 10 that you thought would be fun to talk about.
- 19:50So this is just a 10% sampling, right?
- 19:53This is not exhaustive by any measure.
- 19:55So Julian, want to start on day 51?
- 19:58Okay.
- 19:59So day 51, I chose this one because it had to do with the request module, which was one
- 20:04of the first modules I dealt with when I started learning.
- 20:07Because I wanted to scrape websites, right?
- 20:09And that was the way to get into it.
- 20:11One thing I remember back in the day that I was struggling with was how to deal with a
- 20:16website that had a login prompt.
- 20:17I was like, well, this is impossible.
- 20:19You can't do it.
- 20:20There's no way.
- 20:20Yeah.
- 20:20You can't do a get against that because it redirects you 301 over to this login page.
- 20:25Forget it.
- 20:25Exactly.
- 20:26Screw that.
- 20:26I don't need that data.
- 20:28Who needs it?
- 20:29So I was struggling.
- 20:31And again, for this 100 days, probably one of the complex things was coming up with ideas.
- 20:36And just I remembered that pain point and I Googled it and I found out, oh, you can actually
- 20:41log in with requests.
- 20:42What the hell is this?
- 20:43You know, so I can't believe it.
- 20:45So then I started playing with it.
- 20:46And next thing you know, I was writing a script to log into my freecycle.org account, which
- 20:52is like an eBay thing, but everything's free.
- 20:56And I was able to log into it, scrape my current ads and then save them, you know, report that
- 21:02data and save it back to a database, you know, and it was just a simple script.
- 21:07But the challenge of logging into something using a script was just mind blowing for me.
- 21:12That's really cool.
- 21:13So I, you know, I know that you can do that with requests.
- 21:16I know you can do posts and puts and deletes and all those kinds of things and headers, but
- 21:21maybe walk us through what is the process of like carrying over the session, right?
- 21:25So you go find the logging page, you put the body of like username, password, you do a
- 21:30post.
- 21:31Would you get back a cookie and have to carry that over to the next request?
- 21:36Do you remember how that went?
- 21:37Yeah.
- 21:37Essentially you have this payload as it's called, and you have to input your username and password
- 21:42into it and you do a post.
- 21:44The crazy thing here was that you had to investigate the URLs that you need to send this data to because
- 21:51you can't just send it to the page.
- 21:53You have to go into the background and look for their, I guess their login post request
- 21:58URL.
- 21:58And then I was able to send that data, that payload data to that using requests.
- 22:06And then you get back your session so you can log in.
- 22:09And it was, it's just crazy.
- 22:11That's pretty awesome.
- 22:12Nice.
- 22:13Okay.
- 22:13That one sounds like a really fun one.
- 22:15And it's like, you took this idea that you kind of already had more or less down like request,
- 22:19beautiful soup, CSS selectors.
- 22:21We're going to do this.
- 22:22Oh, wait, here's this next level that I need to like jump over.
- 22:26And, you know, it's really cool.
- 22:27He took one of these challenges and opportunity to do that.
- 22:30Yeah.
- 22:31Yeah.
- 22:31It was, it was awesome.
- 22:32And then, you know, you, you learn stuff along the way.
- 22:35So then it was quite simple to take that data and chuck it into a SQL light database, you
- 22:40know, nice and easy.
- 22:41Yeah, definitely.
- 22:42That's nice and easy for sure.
- 22:44Bob, how about yours?
- 22:46What one do you want to talk about?
- 22:48The very first script I did and day number one, and we were still full of ideas.
- 22:52So there's a handle at Python underscore tip.
- 22:56You might have heard of them.
- 22:58They do a daily tweet of a trick or tip in Python, pretty scientific, but they have some very good
- 23:05tips and get a great following.
- 23:07The way you submit tips to them is via a Google doc, which goes into a spreadsheet or CSV downloadable.
- 23:16But there was not really a way to see if, if a tip was already submitted.
- 23:20So you don't want to clutter their database or spreadsheet with duplicate tips.
- 23:25So I made a little script to just probably request, get the CSV, which is just a public URL, parse
- 23:34it in some data structure and just from the command line, you give it one or more strings.
- 23:38And then it's just a little CLI script.
- 23:43And it then tells you if the string you're looking for, it shows you the tips that has that string in them.
- 23:49So you can just say, oh, OK, they have like already five Ether tools tips.
- 23:53The one I'm about to submit is pretty similar, so I don't do it.
- 23:56And the fun thing is, right, exactly.
- 23:59That was also a nice example of like meeting other developers because then we reached out
- 24:04to them, hey, make this script.
- 24:05This can be helpful for you.
- 24:07And then they, at the submit form, they then linked to the script that people could download
- 24:12that script.
- 24:12I even made a one-liner wrapper that you can do it with a bash, Wget or whatever.
- 24:17Just do one command, even if you don't have the script locally.
- 24:20And yeah, they linked to it.
- 24:22So it was a little bit also for the community if somebody wanted to use that.
- 24:27Yeah.
- 24:28And then we stayed in touch.
- 24:29And later we reached out to Python tip again to do more, to actually associate two code challenges
- 24:36to the great collection of tips they have.
- 24:39So that was kind of a nice script, but also like meeting other developers.
- 24:44Yeah.
- 24:44I think the ability to reach out to people and form these connections is really powerful.
- 24:50You know, that's sort of because GitHub makes it so easy, right?
- 24:55Like it's super easy to connect with people and things like Twitter and so on.
- 24:59It's always been there, but it's really great.
- 25:01And it's like one afternoon of work or something.
- 25:05You've got this little script and now you've got this connection with someone else doing cool,
- 25:10similar stuff, right?
- 25:11Yeah.
- 25:11Yeah, that's awesome.
- 25:12Yeah, for sure.
- 25:13Julian, take us back to day 25.
- 25:15All right.
- 25:16So we're going backwards.
- 25:16You're talking about SQLite before, yeah?
- 25:18Yeah, yeah.
- 25:20So this one, one of the first things I learned with the whole 100 days thing was to use SQLite.
- 25:25So over the years, I remember seeing people using SQL databases.
- 25:29I'm going, I have no idea what I'm looking at here.
- 25:32You guys must be.
- 25:34Yeah, it's so painful to set up and I need a server and the credentials and come on.
- 25:38Yeah, exactly.
- 25:40I don't have time for that.
- 25:41No.
- 25:41It was always one thing that I wanted to do.
- 25:44You know, I saw it and I thought this must be such an amazing skill to have.
- 25:47These people are wizards.
- 25:48I don't know how they do it, you know?
- 25:49And so I learned SQLite 3 using Python and just starting off nice and simple database and
- 25:56names, you know, the usual stuff you might start off with.
- 25:59But then as I was making more things where I wanted to store that data, I was getting really
- 26:04annoyed that I had to keep setting up this database manually.
- 26:08And this is one of my favorite things about the 100 days is that I ended up creating a whole
- 26:13bunch of little scripts that automate these tiny little repetitive processes.
- 26:18And this is one of them.
- 26:19So day 25, I created a script that generates a test SQLite database.
- 26:27So the sort of Python code.
- 26:29See, I've prepared now.
- 26:30I've got it up here on the screen.
- 26:31The Python for the sort of generic database format that I might like with, say, three text
- 26:38columns and one integer column.
- 26:40That was just a very generic test one that I was creating.
- 26:43And this will create that.
- 26:45You just run this command and it prompts you to ask for the name of your database.
- 26:49And that's it.
- 26:50Just creates it.
- 26:51Oh, nice.
- 26:52Yeah, that's how I started it.
- 26:53So I have expanded it.
- 26:55I haven't updated the code on GitHub.
- 26:56Shame on me.
- 26:57Where it asks you then to name your columns and the name of your table.
- 27:01So it walks you through a little almost wizard to set it up.
- 27:05So that was that one.
- 27:07It was actually a lot of fun because then after that, I could just use that every time.
- 27:11Yeah, this is one of the harder things to work in with SQLite is if you map something
- 27:15like SQLAlchemy to it, then you can just say, you know, create all tables right on the
- 27:21models you're mapping and it just does it.
- 27:23But if you don't want to use that, you're like, oh, well, I got to do all the DDL like
- 27:27creation syntax and all that kind of stuff.
- 27:30So this is a nice little thing to have.
- 27:32Yeah, it was very useful.
- 27:33The SQLAlchemy that's coming next.
- 27:36That's a good one.
- 27:38And by the way, if you're listening and you want to follow along, I'll have the link to
- 27:42your GitHub repository.
- 27:45That's the 100 days of code.
- 27:47So every one of these is just numbered by day.
- 27:50So it's github.com/pybytes, P-Y-B-I-T-S, 100 days of slash 100 days of code.
- 27:56So you guys can follow along.
- 27:58It has the numbers right there.
- 27:59All right, Bob.
- 28:00One of the challenges, if you want to do any sort of testing is external dependencies, right?
- 28:05Especially APIs.
- 28:06And if they're like rate limited or something, it's even worse.
- 28:09Or if they're going to make modifying changes like post something.
- 28:12So your number 81 has some cool examples of how to get around this, right?
- 28:16Exactly.
- 28:17That's the problem with external APIs.
- 28:19You don't want to call them over and over again when you run your test.
- 28:23So I spent one day looking at unit test mock patch to mock test the T-PY API.
- 28:32And yeah, I managed to do a little script to populate some fake data and do the patch object
- 28:40decorator.
- 28:41Kind of fake the call to the T-PY API.
- 28:45And yeah, that worked out pretty well.
- 28:47It was not a critical script, but that's really where you do the coding just for the sake of
- 28:52practice.
- 28:53Because the original script was just a funny who tweeted what.
- 28:57Because somebody on Twitter asked like, okay, so whom I'm talking to?
- 29:02It's PyBites.
- 29:03Is this Julian or Bob?
- 29:04So we made a little script that based on the location of the tweet, it would then return
- 29:09Bob or Julian because Julian is in Australia and Spain.
- 29:12Oh, yeah, that's awesome.
- 29:14So you can just test by the geolocation.
- 29:16Nice.
- 29:17Exactly.
- 29:17So I took this example to show that you can just go like random stuff.
- 29:22It can be funny and just get practice.
- 29:25But then who tweeted script then actually raised this second need to practice mocking and how
- 29:33to test an external API.
- 29:34So that was then a second script.
- 29:35So one script follows the other.
- 29:37So that's the nice thing.
- 29:38Just get started.
- 29:39And yeah, you might be afraid that you don't get to the 100, but you will.
- 29:44Yeah, that's awesome.
- 29:46This portion of Talk Python To Me was brought to you by GoCD.
- 29:49GoCD is an on-premise, open source, continuous delivery tool to help you get better visibility
- 29:55into and control of your team's deployments.
- 29:58With GoCD's comprehensive pipeline modeling, you can model complex workflows for multiple
- 30:03teams with ease.
- 30:05And GoCD's value stream map lets you track changes from commit to deploy at a glance.
- 30:10Say goodbye to deployment panic and hello to consistent, predictable deliveries.
- 30:14We all know that continuous integration is super important to the code quality of your applications.
- 30:19Choose the open source local CI server, GoCD.
- 30:23Learn more at talkpython.fm/GoCD.
- 30:26That's talkpython.fm/GoCD.
- 30:29So maybe really quickly tell people about the patch.object decorator.
- 30:34So this is a decorator that you can put on any block of code, but typically maybe write
- 30:40on a particular unit test method.
- 30:42Yes.
- 30:43And it will reach deep down inside and change the implementation of some part of probably
- 30:49that API or really whatever you pointed out, right?
- 30:51Like time, for example.
- 30:52Yes.
- 30:53So it has been a while this script, but the decorator wraps a unit test method and it calls
- 31:00the CPI API, so the original method.
- 31:02But you're kind of replacing the original git status method of that API with, you give it a
- 31:09return value, which is then the fake data defined in the main body of the script.
- 31:13So it's like I'm faking calling that API, returning my own data, and I'm not making the network
- 31:20call.
- 31:20That's basically what it's doing.
- 31:22Yeah, that's super cool.
- 31:23Yeah.
- 31:24Yeah.
- 31:24Very nice.
- 31:24Let's see.
- 31:25Next up, Julian, Word Scramble.
- 31:27Tell us about the Word Scramble one.
- 31:29All right.
- 31:29So let me just say a quick disclaimer.
- 31:31I'm not a cheater at Words with Friends, but I may have used this one.
- 31:36But if one were to.
- 31:38But if someone was to play Words with Friends, this might be helpful.
- 31:42So I remember, you know, back in the day, playing Words with Friends a lot.
- 31:46There were people who would use these little apps on their iPhone to put the letters in
- 31:52and it would unscramble that into a whole dictionary list of possibilities.
- 31:57Right.
- 31:58And that was the inspiration for this.
- 32:00Not that I ever used one of those.
- 32:02Right.
- 32:02That would be wrong.
- 32:03You shouldn't do that.
- 32:04So if I've ever beaten anyone with Words with Friends, I wasn't using this.
- 32:08So the idea is that it's exactly just that.
- 32:11I just Googled a standard dictionary.txt, just the whole dictionary and text file.
- 32:17And yeah, I used itatools permutations to then read in the words that you will enter into this app and compare it to the dictionary and then come up with whatever valid words you could make out of that series of letters that you enter.
- 32:36And that was it.
- 32:36It's simple in concept.
- 32:38It actually took me a while.
- 32:40I ended up calling Bob on this one and saying, oh, man, what am I doing wrong?
- 32:44You know, and I showed him the code.
- 32:46And this is the beauty of the whole PyBytes relationship, right?
- 32:49And I told you, like, AetherTools, permutations.
- 32:51Dude, you're growing.
- 32:53I mean, look where you are.
- 32:56This is awesome.
- 32:56Yeah, this is super cool.
- 32:59It would have been an ugly for loop, I think, when I started.
- 33:02Yeah, I think that's one of the things that you have to learn as you get better in Python is I probably could implement this algorithm or I could probably pip install this algorithm.
- 33:13So let's do that instead.
- 33:15I mean, I know AetherTools is built in.
- 33:16But yeah, just knowing the stuff that you can use, like the pre-built things like AetherTools permutations, rather than going, well, how do I implement a permutation?
- 33:25Well, let me think about like a nested loop, right?
- 33:27Yeah, well, on that, one of the worst things is you'll spend time on something.
- 33:31And then 10 minutes later or even 10 days later, someone like Bob goes, why don't you just use permutations?
- 33:37And you'll be like, oh, there's a permutations.
- 33:41This existed?
- 33:42Damn it.
- 33:43Yeah, exactly.
- 33:46That's never ending because even if you think you have some Pythonic tricks up your sleeves, there's always more.
- 33:53There's so many constructs still learning.
- 33:56Sure, there's a bunch built in.
- 33:57I feel like a lot of them live in AetherTools and Functools and those sorts of things.
- 34:01But just also, there's 120,000 plus on PyPI, right?
- 34:06Like if you run out of standard library tricks, there's a few more out there.
- 34:09Indeed.
- 34:09Yeah.
- 34:10That's awesome.
- 34:10All right.
- 34:11So the next one up is using a pillow to create images in Python.
- 34:16Bob, tell us about that.
- 34:18Yeah, I picked this one because it's a tool that we still use today.
- 34:22Just, again, a simple prototype.
- 34:24Just give it a URL and some text.
- 34:27Downloads the URL image.
- 34:28It puts it on a canvas.
- 34:29And it puts your text on top of it, which makes a reasonable banner.
- 34:34It's not like Photoshop art, but it's good enough.
- 34:38And, yeah, I think, or this script or some code channels morphed into it.
- 34:44But we start, we're still using this to make PyBytes banners for new code challenges articles.
- 34:50Oh, nice.
- 34:51So you can like auto generate like day 31, day 32, day 33 for each one.
- 34:57That's the thing.
- 34:58I think later we wrapped it in some Flask GUI.
- 35:00So we just have a form.
- 35:02And we give it the text and the background image URL there.
- 35:07And it makes the banner there.
- 35:09And you can just click download or even download it directly to your.
- 35:13So I make a banner in 10 seconds now or less.
- 35:16That's awesome.
- 35:16That's way better than like living in Photoshop all the time.
- 35:19Yeah, we don't want that.
- 35:20We want to go.
- 35:21Yeah, yeah, for sure.
- 35:22Yeah, I think that's really cool.
- 35:24I mean, I had a similar experience recently when I wanted to make all the, I wanted to
- 35:29create audio versions of my online courses.
- 35:32So how do you take MP4s, convert them to MP3s?
- 35:36Then how do you go and put like, this is the title.
- 35:39This is the album.
- 35:40This is this track in this album.
- 35:42And, you know, you find something cool like Pillow or, you know, it's not actually Pillow,
- 35:47but like there's just these like little libraries that you wouldn't necessarily think is easy
- 35:51to work with.
- 35:52Like it doesn't seem like it'd be that easy to work with images, but you know, here
- 35:55it is.
- 35:56Right.
- 35:56Same thing for like IDX tags and MP3s.
- 35:58Very cool.
- 35:59Yeah.
- 36:00So Julian, what about this steam scraper?
- 36:03Okay.
- 36:03So I love games.
- 36:05And that's probably one of the worst things about PyBytes is that I have less gaming time
- 36:09than ever.
- 36:10This was actually a fun project for me.
- 36:13It actually spanned a few days and it was made up of a few scripts that I made throughout
- 36:17this entire series.
- 36:20This one I still use.
- 36:21What it does is, and I know someone out there is going to be listening and say, why don't
- 36:25you just use the RSS feed?
- 36:27Well, who cares about the RSS?
- 36:29The whole point is to make this, right?
- 36:31What I did was I scraped the RSS feed using this scraper.
- 36:37And this is Steam.com, store.steampad, you know, the Valve game service.
- 36:41And I scraped the RSS feed for all the latest games.
- 36:45Either way, I was scraping that file.
- 36:47I was passing that file, sorry, using a feed parser as well to then get all of the games,
- 36:54just the titles and the URLs, dump that into a database.
- 36:59Okay, so that was like one section that took me a day or two to wrap my head around because
- 37:03I'd never used feed parser at this point.
- 37:05Then there was the whole emailing myself the notification that these games were released,
- 37:11you know.
- 37:12So I'd written an email script at the start of this entire series.
- 37:15And then the catch was I was spamming myself with every new game multiple times.
- 37:22So I'm going, well, I already know that game's released.
- 37:25I've already bought that game.
- 37:27I don't want to be told again.
- 37:28So then I spoke with Bob and he said, oh, you know, I've conquered this problem before.
- 37:32I've encountered it just at a zero one flag.
- 37:35And that was it.
- 37:37I just mind blown, you know, just I was like, oh, sweet.
- 37:40So then I, in the database, added a new column.
- 37:43Every existing game, every time something's added, it's given a flag of zero.
- 37:47And then once it's been emailed out, it then gets a flag of one.
- 37:51And then you only email out the zeros.
- 37:53Yeah, that's actually really, really cool.
- 37:55So tell me about feed parser.
- 37:57That was actually complex for me because I'd never had to pass XML before.
- 38:03And so trying to drill your way down through these nested XML tags just did my head in.
- 38:10And I remember crying one night, huddled in a corner, you know, with a blanket over me.
- 38:16The namespaces.
- 38:18The namespaces.
- 38:20Exactly.
- 38:20And, you know, Bob called me and he said, what's wrong, my son?
- 38:24How can I help you?
- 38:26You know, and I talked to him about it.
- 38:29And he showed me the name Tuple.
- 38:32And at that point, I'd never used the name Tuple.
- 38:35So this is what I mean.
- 38:36You know, Bob knows these things and I'm still grasping at straws sometimes.
- 38:40So I was like, what's the name Tuple?
- 38:43And he walked me through it.
- 38:44You know, I remember this phone call was about half an hour as he's telling me all these things.
- 38:48And I'm like, this is amazing.
- 38:49And he'd already had a script that used name Tuple.
- 38:51So he used that as an example.
- 38:53And then I was able to use that, find the correct names and links and then save the data.
- 39:00And, you know, my code, I was hacking my way down.
- 39:03And it just became like five lines as opposed to, you know, 20 or 30.
- 39:08Yeah.
- 39:08And you don't need to know all the XPath expressions to search through it.
- 39:11This is really awesome.
- 39:12So FeedParser just understands RSS1, RSS2, Atom, all that.
- 39:18And you could just ask it questions after it loads up an XML feed.
- 39:21Yeah, pretty much.
- 39:22Exactly right.
- 39:23I was just looking for those tag names and it just knew it.
- 39:27It just found it.
- 39:28It was able to search that stuff for me.
- 39:30So I loved it.
- 39:31Oh, that's sweet.
- 39:31All right.
- 39:32So the next one, you know what I enjoyed talking?
- 39:35I mean, I enjoy a lot of things about talking to you guys.
- 39:37But one of the things that's really cool about going through this is like, I didn't know about FeastParser.
- 39:40I just, you know, import elementary and just go after with XPath.
- 39:43Like, apparently I don't need to do that anymore.
- 39:46That's really, really cool.
- 39:47And so, I mean, it's not a huge deal for me, but it could, if it was just automatic, that would be better.
- 39:52And I think for the next one as well, I've never played with PyGitHub, but apparently on day 84, you did, right, Bob?
- 39:59Yeah.
- 40:00All right.
- 40:00What is this one?
- 40:01Simple prototype again, just a little script to functions to get a user object from the GitHub API and show stats, all the stats for all his or her repos.
- 40:13So the stars and the forks.
- 40:15Yeah.
- 40:16The funny thing is, as you say, you raise awareness to yourself that that library exists.
- 40:22And the funny thing is, now that developing something bigger for our code challenges, where I do use a lot of GitHub integration, I went back to that library again.
- 40:34Yeah, that's really cool.
- 40:35I mean, GitHub does have like a straight up HTTP JSON API, but having a wrapper over top of it.
- 40:41So you just say get user or, you know, repo.fork.
- 40:45That is so much nicer than actually parsing the dictionaries.
- 40:50I do have to say that recent acquire PDB skills helped me because there was, now that I'm digging deeper into the GitHub API, the PyGitHub, there was not, documentation was a bit limited.
- 41:03But that was actually also a blessing to inspect objects with PDB set trace and really look into it.
- 41:10I mean, GitHub APIs is huge.
- 41:12Yeah, that's pretty massive.
- 41:13And you can do a lot of fun stuff with it.
- 41:15So highly recommend it.
- 41:17Yeah, very cool.
- 41:17All right, let's talk about some Flask apps that you worked on, Julian.
- 41:23All right, so you probably know by now, Mike, I'm a bit of a Flask addict.
- 41:27I can't get over it.
- 41:28So this was something, so for a long time, I wanted to be able to make web apps.
- 41:33And I had no idea.
- 41:34And I thought it was magic how people were able to have this script turn into a web page.
- 41:38And I never understood how they did it.
- 41:40It scared me approaching it.
- 41:43And Bob pointed me at Flask and he said, try this.
- 41:47And first of all, I went through the Flask documentation and I just melted.
- 41:51I was like, what is this?
- 41:52This is so detailed and complex.
- 41:54This is crazy.
- 41:55This is sort of route maps and methods and views and templates and template language and models.
- 42:01And ah.
- 42:01Exactly.
- 42:02Exactly.
- 42:03This whole new language.
- 42:04It's like learning a whole new programming language.
- 42:06And I ended up going through 20 different sources.
- 42:09You know, I was checking YouTube.
- 42:11I was Googling.
- 42:12Like three or four new languages, right?
- 42:13It was just crazy.
- 42:15So I said, this is something I have to learn.
- 42:17And I ended up writing, I think, three or four Flask apps as part of this hundred days.
- 42:23So I won't go into each one in too much detail.
- 42:26But every one of them was something different.
- 42:29It was like a new sort of Flask skill that I hadn't dealt with before.
- 42:32So my three favorite that I wrote, I wrote a BMI calculator.
- 42:36So that's body mass index.
- 42:37Just a simple calculation, right?
- 42:39On the command line.
- 42:41But to turn that into a workable form on a website that someone can enter in the data.
- 42:47And then it actually shows that result, your BMI, on the same page.
- 42:53Like that, that was difficult for me.
- 42:55You know, I was just thinking, how do I do this?
- 42:58So that was pretty cool.
- 43:00So that involved having to have a div below the form.
- 43:05So the form entry field is quite simple.
- 43:07But there's a hidden div that doesn't appear unless a certain variable exists.
- 43:13And it was actually really cool.
- 43:15I felt like I was a magician.
- 43:17I felt like a hacker.
- 43:18I was like, man, this is cool.
- 43:19I love building web apps like that.
- 43:21It takes a while to put the pieces together.
- 43:23But once you have them, you're like, whoa, look at it work.
- 43:25Exactly.
- 43:26It's mesmerizing.
- 43:26I still use it, even though I don't care about my BMI.
- 43:29I just do it every now and then.
- 43:31Another one was a pay calculator.
- 43:34You can tell I care about my pay, right?
- 43:36No, just that the whole overtime thing that Bob helped me with a year and a half ago.
- 43:40I wanted to calculate how much money, if you work X many hours at this rate, how much it makes.
- 43:46I thought that's a simple use case.
- 43:48The cool part is that it uses Flask sessions.
- 43:51So it saves your hourly rate as a session object.
- 43:56And then you can keep using that session object to calculate different hours.
- 44:01You don't have to enter it in every time.
- 44:03And yeah, and to test it out, I had the first page as a way you enter it in and it's saved as a session object.
- 44:10And the second page.
- 44:12So when you browse to the second page, the session object carries over.
- 44:17And that was the challenge for this specific app.
- 44:20So that was really cool.
- 44:21And the last one was one of my favorites because it was the first Flask app that I wrote that uses an external API.
- 44:28Actually, was it an external API?
- 44:30No, I think it was a time zone list.
- 44:33Either way, it was it imports every time zone on the planet and then populates a pull down menu with it.
- 44:41So then you choose that time zone and it tells you what the current time is in that country or in that space compared to your current time.
- 44:48So, yeah, it was actually really, really cool.
- 44:51I enjoyed that.
- 44:52That was difficult populating that list with data from some other function.
- 44:57So that was the challenge for this one.
- 44:59Yeah, yeah.
- 44:59That sounds really cool.
- 45:00Very, very nice.
- 45:01And obviously that love of Flask carried on over after this finished and that's how I got started with the Flask course.
- 45:09Yeah, exactly.
- 45:09We'll definitely talk a little more about that at the end.
- 45:12That's awesome.
- 45:12So last one, Bob.
- 45:14Let's talk about some automation.
- 45:16Autogen, I don't know.
- 45:17Pelican, I know.
- 45:18Slack, I know, but I've never done anything with it.
- 45:20Tell us about all these things.
- 45:21Yeah, I couldn't choose.
- 45:22So I put them all under the automation.
- 45:24I'm going to automate all the things, just all of them.
- 45:26Automation buckets.
- 45:28So to start with, so it was funny because with the 100 days, you do a tweet of your progress every day.
- 45:36So that was the first common thing to automate, to have it reach out to our log file on the GitHub repo, read in a day, and automatically tweet what's in there.
- 45:47Which also put a bit of pressure on us because we had a bit of pressure on us because we had this daily deadline at 22.43 p.m.
- 45:53The bot's going to get there.
- 45:54The bot's going to get there.
- 45:55The bot's going to get there quick.
- 45:56The bot is going to get us.
- 45:57It's going to get the text.
- 45:58If it's blank, I have to delete the tweet.
- 46:00It's not a shame, but it's a shame.
- 46:03So it put actually pressure on us.
- 46:06But yeah, we saved a lot of time with that.
- 46:08There were Slack bots.
- 46:09So for example, a neat tool that could actually help people in marketing.
- 46:14When your domain gets mentioned on Twitter, it gets posted to a Slack channel.
- 46:19So I mean, if you get retweeted or stuff, you notice it in notification.
- 46:23But if somebody just tweets your URL or mentions your URL in any sense, you don't.
- 46:28Right.
- 46:28And that happens a lot if somebody just discovers like a page or something you've done that's cool.
- 46:33And they just shared on Twitter.
- 46:34They might not even know about your Twitter account or forget to put it in there.
- 46:37So yeah, you'll find a lot of stuff if you search for your domain outside of your Twitter name.
- 46:42Yeah.
- 46:43So we see that all on Slack now.
- 46:44Pelican.
- 46:45Yeah, we write some articles and we have quite some entries.
- 46:49So I made a little command line tool to just do some inputs and ask some questions about topic and tags.
- 46:57And then generates a markdown file with the right formatting, which again,
- 47:02saves some time off every time we have to write a post.
- 47:04Yeah, Slack is really cool.
- 47:06We have a challenge going on now to build a chatbot.
- 47:10And the most original submission we'll get.
- 47:12Actually, we buy them a book.
- 47:14We're really fond of chatbots.
- 47:17And one I wanted to mention, that idea that grew from the 100 days was a karma bot.
- 47:22So when you're in Slack, you do like, HipChat uses it.
- 47:26When you do like user or subject plus plus or minus minus, a karma bot just keeps track of the score.
- 47:33And that was all kind of stuff, prototypes that were born out of the 100 days.
- 47:38Wow.
- 47:38That's really cool.
- 47:39Yeah.
- 47:39A lot of stuff came out of there.
- 47:40All right.
- 47:41So that's one tenth of what you guys learned.
- 47:43And I feel like that was super valuable just talking through that with you.
- 47:46So that's pretty awesome.
- 47:48Julian, do you recommend people try this 100 day code challenge?
- 47:51Or is it like too intense?
- 47:53Is it like a P90X or whatever?
- 47:56No, no.
- 47:56I totally think you need to do this.
- 47:59If you're interested in programming at any way, shape, or form, you should totally do it.
- 48:04The only advice I'll give is that it's tough.
- 48:08There are days where you're going to want to go out with your mates.
- 48:11And you're going to come home at 11 p.m.
- 48:13And you'll be probably drunk.
- 48:15And you'll be like, I have to write some code.
- 48:17And you'll have to prep.
- 48:20Maybe do more the day before.
- 48:23This whole script a day thing was over the top.
- 48:26So it was something I think we may do one day, again, if we're crazy.
- 48:31But the whole just building a pattern and the repetition to make you learn something every day.
- 48:39So this we apply to other things as well.
- 48:41It's not just 100 days of code now for us.
- 48:43But the main thing is if you are married and you have kids, please take that into account.
- 48:50Because that was one of the biggest hurdles with us is that it's like you'll have family time and then you'll have to go, I've got to go write a script.
- 48:58They don't understand.
- 48:59It's not their thing, right?
- 49:00So you have to run away.
- 49:01You have to.
- 49:02That was the hardest thing to balance, to be honest.
- 49:04So if you can plan, tell your better half, look, here's what I'm doing.
- 49:08Work it out.
- 49:08Even plan a time of the year where work isn't too crazy.
- 49:12But plan it in advance.
- 49:13Don't just jump on it because it can be pretty taxing.
- 49:16Yeah, of course.
- 49:17You know, one thing that comes to mind while you're speaking is maybe this doesn't have to be outside work, right?
- 49:22Maybe you could get an hour of work at your job saying, hey, dear manager, I'm trying to learn this thing.
- 49:29And, you know, I have this training budget.
- 49:30Could you just give me time instead of, you know, a class with a bunch of boring slides anyway?
- 49:35Like, I'll just do this.
- 49:36That's an amazing.
- 49:37Or something along those lines, right?
- 49:39That's a really good idea.
- 49:40I'm going to take that to work and try that.
- 49:43Nice.
- 49:43Yeah.
- 49:43That's a good.
- 49:44Thanks, man.
- 49:45You should.
- 49:45Let us know how it goes.
- 49:46Yeah.
- 49:47It's a good return on investment because you're really practicing.
- 49:51And to really to learn the program, it requires a lot of hours of deliberate practice.
- 49:57And 100 Days of Code does that.
- 49:59Yeah.
- 50:00I feel like you guys must have got a lot of confidence and, like, capability with other libraries that you otherwise wouldn't have touched.
- 50:07Exactly.
- 50:07Two, right?
- 50:09Yeah.
- 50:09Very cool.
- 50:09Okay.
- 50:10So, you also have another one.
- 50:11And I don't even know where you are in the timing of it.
- 50:14But it went around Django specifically, not just Python in general.
- 50:19Tell us about that.
- 50:19Yeah.
- 50:20So, after 100 Days of Code, we were kind of a bit tired.
- 50:24But, nevertheless, we started a new 100 Days.
- 50:26It was a bit looser.
- 50:28So, we didn't do, like, a daily tweet anymore because, I mean, Django apps are typically, like, long, stretched projects.
- 50:36You have to do something like Django page view per day or an API endpoint per day or something.
- 50:42We weren't, like, that strict on it.
- 50:45But, yeah, we did manage to do two or three apps.
- 50:48For example, we made a lot of things like that.
- 50:49So, we made a lot of things like that.
- 50:49So, we made a lot of things like that.
- 50:49So, we made a lot of things like that.
- 50:49So, we made a lot of things like that.
- 50:49So, we made a lot of things like that.
- 50:49So, we made a lot of things like that.
- 50:49So, we made a lot of things like that.
- 50:50So, we made a lot of things like that.
- 50:50So, we made a lot of things like that.
- 50:51So, we made a lot of things like that.
- 50:52So, we made a lot of things like that.
- 50:52So, we made a lot of things like that.
- 50:53So, we made a lot of things like that.
- 50:54So, we made a lot of things like that.
- 50:55So, we made a lot of things like that.
- 50:56So, we made a lot of things like that.
- 50:57So, we made a lot of things like that.
- 50:58So, we made a lot of things like that.
- 50:59So, we made a lot of things like that.
- 51:00So, we made a lot of things like that.
- 51:01So, we made a lot of things like that.
- 51:02So, we made a lot of things like that.
- 51:03So, we made a lot of things like that.
- 51:04So, we made a lot of things like that.
- 51:05So, we made a lot of things like that.
- 51:06So, we made a lot of things like that.
- 51:07So, we made a lot of things like that.
- 51:08So, we made a lot of things like that.
- 51:09So, we made a lot of things like that.
- 51:10So, we made a lot of things like that.
- 51:11So, we made a lot of things like that.
- 51:12So, we made a lot of things like that.
- 51:13We made a lot of things like that.
- 51:14So, we made a lot of things like that.
- 51:15So, we made a lot of things like that.
- 51:16So, we made a lot of things like that.
- 51:17So, we made a lot of things like that.
- 51:18So, we made a lot of things like that.
- 51:19So, we made a lot of things like that.
- 51:20So, we made a lot of things like that.
- 51:21So, we made a lot of things like that.
- 51:22So, we made a lot of things like that.
- 51:23So, we made a lot of things like that.
- 51:24So, we made a lot of things like that.
- 51:25So, we made a lot of things like that.
- 51:26So, we made a lot of things like that.
- 51:27So, we made a lot of things like that.
- 51:28So, we made a lot of things like that.
- 51:29So, we made a lot of things like that.
- 51:30Yeah.
- 51:31Still, we got quite some stuff done.
- 51:33Yeah.
- 51:33That's awesome.
- 51:34And so, this one is also done?
- 51:35Yeah.
- 51:36It's done.
- 51:37Yeah.
- 51:38I mean, the deadline is over.
- 51:39And now, we take a little bit of rest to prepare for another.
- 51:41Rest.
- 51:42Come on.
- 51:43You got time for one and a half more this year.
- 51:45Right.
- 51:46Basically, we're focusing on our project.
- 51:47Yeah.
- 51:48He meant the rest framework.
- 51:49That's what he meant.
- 51:50That's right.
- 51:51Right.
- 51:52Django rest framework.
- 51:53100 days of it.
- 51:54Perfect.
- 51:55Awesome framework.
- 51:56Nice.
- 51:57So, I think, you know, get a look at the time.
- 51:58We'll probably just leave it here for this topic.
- 52:00But I feel like this was super valuable.
- 52:02Looking at the 10 you chose and talking about them, I can definitely see the value of doing
- 52:06them.
- 52:07And I've learned a few things myself.
- 52:08So, you know, thanks for walking us through this.
- 52:10Nice.
- 52:11No worries.
- 52:12Yeah.
- 52:13Awesome.
- 52:14So, before you guys get out of here, though, you have to face the two questions.
- 52:15So, first of all, we'll start with you, Bob, I guess.
- 52:18If you're going to write some Python code, what editor do you use?
- 52:21Vim.
- 52:22Vim.
- 52:23All right.
- 52:24On.
- 52:25And notable PyPI package.
- 52:26Play with 100 packages or modules in this whole thing.
- 52:29So, probably found some cool ones.
- 52:30Can we still say request?
- 52:31You can still say request.
- 52:32That's awesome.
- 52:33Maybe for data analysis, I would say pandas.
- 52:35We didn't really use it in 100 days, but it's an excellent tool to do any kind of data
- 52:41analysis.
- 52:42Yeah, absolutely.
- 52:43All right, Julian.
- 52:44Obviously, on the command line, it's going to be Vim.
- 52:46And Bob, don't hate me, okay?
- 52:47Please don't hate me.
- 52:48On Windows, I actually use Notepad++.
- 52:51And I love it.
- 52:52I know.
- 52:53It's crazy.
- 52:54I've known some people that love Notepad++ as well.
- 52:56Very cool.
- 52:57And notable PyPI package.
- 52:58Okay, so I'm going to just say two.
- 53:00Obviously, Flask.
- 53:01Well, okay, that's not PyPI.
- 53:02All right.
- 53:03Yeah, yeah, it's on there.
- 53:04It's on there.
- 53:05Is it?
- 53:06Oh, okay.
- 53:07Sorry, I thought you meant like a part of standard lib.
- 53:08No, no.
- 53:09Outside the standard lib.
- 53:10External stuff.
- 53:11There are probably two.
- 53:12I won't go into that.
- 53:13But actually, this is an interesting one because I'm pretty terrible at it.
- 53:17pytest.
- 53:18It was only in the past month that Bob was pushing me on this one, going, "You've got
- 53:21to try this," you know?
- 53:22And it just worked.
- 53:24It's so easy to just get like boring and go, "Ah, just import, you know, unit test and just
- 53:30use that it's right there.
- 53:31Like, there's nothing to it, right?"
- 53:32And I was not very good at testing my own code and I'm still terrible at it.
- 53:36But it was just this whole different way of looking at it.
- 53:39So definitely pytest.
- 53:40All right.
- 53:41Oh, yeah.
- 53:42Those are both very, very good ones.
- 53:43Awesome.
- 53:44All right, guys.
- 53:45People are interested in this.
- 53:46Like, how can they participate?
- 53:47Maybe can they join like your community somehow to like sort of have some support while they
- 53:52go through?
- 53:53Or what do you think?
- 53:54Bob, go first.
- 53:55Yeah.
- 53:56So PyBytes, video articles, co-channels, news, and projects.
- 53:59If you really want to practice, I really recommend to go through the list of code challenges
- 54:05we have.
- 54:06We have 44 now, up until now.
- 54:08And pick whatever you like and clone the repo or fork the repo and make your branch and start
- 54:15trying to do these challenges.
- 54:16We have seen people growing a lot.
- 54:18They thought like, "Ah, I cannot do it."
- 54:20Then they did it.
- 54:21Then they thought they would have some lame submission and they actually came up with solutions.
- 54:26We were like, "Wow."
- 54:27First off, we were like, "Wow, I'm not even sure what it is."
- 54:32You know?
- 54:33So we were learning from them as well.
- 54:34But it works.
- 54:35It's incredible.
- 54:36So really, people and ourselves too, we're really stretching ourselves through these code
- 54:40challenges.
- 54:41So that's really what I would recommend from our site.
- 54:45Yeah, that's awesome.
- 54:46Julian, how about you?
- 54:47Yeah, so from a, I guess, from the beginner standpoint, for anyone listening, just stop
- 54:52procrastinating and start coding.
- 54:54It's literally learn by doing.
- 54:56That's just the greatest way to do it.
- 54:58And again, obviously a plug, you've got to try the code challenges.
- 55:01They will force you to just to learn new things.
- 55:04And because you're getting told in the challenges what you have to do and what you have to learn,
- 55:08that's an even better way.
- 55:10So do the 100 days of code challenge.
- 55:12But the most important thing is to just start writing code.
- 55:16That's it.
- 55:17Awesome.
- 55:18And speaking of writing some code, you started working with Flask.
- 55:22You talked about how you fell in love with it.
- 55:23You have a course on Udemy for Flask, right?
- 55:27That's right.
- 55:28Yeah, quickly tell people about it before we get out of here.
- 55:30Yeah, just super quick.
- 55:31It's a beginner's Flask course.
- 55:32It is totally intended for beginners because, as I mentioned before, the Flask documentation,
- 55:37trying to find and understand everything was quite difficult to piece it all together.
- 55:41So I've made this course.
- 55:43Bob and I have worked on it.
- 55:45And it's just designed to really sell it in layman terms.
- 55:48So if you don't understand, we walk you through all the steps to write your first Flask app,
- 55:53get the basics down.
- 55:54And we will expand this later as we go.
- 55:56And we are working on more courses.
- 55:58But this one is the way to get into it.
- 56:00And it's actually really fun.
- 56:01Feedback's been great.
- 56:02And we've got a link for you, Mike, with a discount code for anyone listening.
- 56:07Yeah, I see.
- 56:08Right.
- 56:09It's got the coupon code in there.
- 56:10So I'll put that in the show notes and people just click it there and they get a discount
- 56:12and you'll know it came from the podcast, which is awesome.
- 56:15Cool.
- 56:16All right, guys.
- 56:17Well, thank you for doing this project and sharing all the stuff you do at PyBytes with
- 56:20the community and now sharing it with everyone listening to the podcast.
- 56:23No worries.
- 56:24Thanks for having us, Mike.
- 56:25You bet.
- 56:26Bye.
- 56:27Bye.
- 56:28This has been another episode of Talk Python To Me.
- 56:31Today's guests have been Bob Beldrbos and Julian Securia.
- 56:35And this episode has been brought to you by Rollbar and GoCD.
- 56:39Rollbar takes the pain out of errors.
- 56:41They give you the context and insight you need to quickly locate and fix errors that might
- 56:46have gone unnoticed until your users complain, of course.
- 56:49As Talk Python To Me listeners, track a ridiculous number of errors for free at rollbar.com/talkpythontome.
- 56:56GoCD is the on-premise open source continuous delivery server.
- 57:01Want to improve your deployment workflow, but keep your code and builds in house?
- 57:05Check out GoCD at talkpython.fm/gocd and take control over your process.
- 57:11Are you or a colleague trying to learn Python?
- 57:13Have you tried books and videos that just left you bored by covering topics point by point?
- 57:18Well, check out my online course Python Jumpstart by Building 10 Apps at talkpython.fm/course
- 57:24to experience a more engaging way to learn Python.
- 57:27And if you're looking for something a little more advanced, try my Write Pythonic Code course
- 57:31at talkpython.fm/pythonic.
- 57:33Be sure to subscribe to the show.
- 57:36Open your favorite podcatcher and search for Python.
- 57:39We should be right at the top.
- 57:40You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct RSS feed
- 57:47at /rss on talkpython.fm.
- 57:49This is your host, Michael Kennedy.
- 57:51Thanks so much for listening.
- 57:52I really appreciate it.
- 57:53Now get out there and write some Python code.
- 57:56Thank you.
- 58:04Thank you.