Video | PyCon | How to | Writing | Blogging | Review

The video is a very nicely paced talk about how to write a great programming blog (or any other topic really). It’s at PyCon 2016 in Portland, Oregon. He really takes his time and has great slides that simplify what he’s talking about. The Youtube description also has links to the actual slides on Github too.

It’s 27:00 minutes long roughly and it has great audio with the speaker in the corner of the screen to leave room for the slides. He uses a classic teaching structure:

  • tell them what you’re going to tell them
  • tell them
  • tell them what you’ve told them

I personally found it very inspiring as I have been publishing blogs since 2005 (e.g. such as this short post written by myself from almost exactly 11 years ago that links to an intriguing article by George Monbiot about choosing a career). Sometimes I may spend hours over one blog post so it’s great to hear someone describing blog posts as articles or essays.

At the end of the talk he provides a bit.ly link that takes you to his essay about writing great content (which I’ve not read yet). He provides some great yet simple ideas such as reading articles all the way to the end and asking yourself whether it was an effective article or not. The main idea behind the talk is that he provides techniques, concepts and structures that will help if you write blogs but struggle to find the time etc.

Python | Conditional Main Program

Code example
Code example

Today I learned about the use of a “conditional main program” when programming Python. I read about this in a great Python tutorial PDF from Southampton Uni.

You may write some code that is only intended to be used as a module for another program. So if you try running the module directly you may well get no output or response. But, if you include the code below

if __name__ == " __main__ " :

and if you include some functionality to this function, you will get some handy output. It means you can run a module as its own program. You could get it to give some instructions about the correct use of the actual program or use it as an example of what the main program is supposed to do.

Go to page 73 of the PDF for a better explanation! Or this blog post about the same topic.

And here is a page about Spyder and part of a book on computational programming that also covers Spyder.