Kevin Carmody: machines, media & miscellanea

Elsewhere: Mastodon, Github, Email

Monkey Flask

So it turns out that in GCSE computing, they have to learn Python now. How wicked is that?! I’ve been helping out my girlfriend’s cousin with hers and I’ve been having to quickly learn bits of Python on the fly so I can answer her questions. It’s a pretty standard language, so it’s just about getting the syntax and nomenclature right.

While I’ve been there playing with Python, I thought I’d check out some of the web frameworks. I chucked up a little repo called Monkey where I can try out Flask. If you haven’t tried Flask, then I highly recommend it. It’s got a real simple approach that allows you to throw a few pages together with little effort and you’ve got a small webapp.

Things I learnt that I like:

Decorators. Flask makes extensive use of these for things like setting up routes. You can see where annotations in the Symfony world were thought up, except in Python it doesn’t feel like it’s been tacked on.

virtualenv. I love RVM, NVM and now VENV. I get pumped for version managers ;)

jinja2: Actually, I like this just because it’s like TWIG and Django templates and Mustache and … templating is converging, it’s a great thing!

I’m sure that’s just a scratch of the surface, but I think it’s good to have a play around with different tech whenever you get the chance, if not  just to see how they do it in other environments.


Webmentions