Articles tagged with python

  1. [Python] Socket Timeouts in urllib2

    Posted on in Programming

    Things have changed quite a lot since this post was originally written in 2016. Currently, I would recommend switching over to making asynchronous calls via aiohttp.

    One of my scripts that makes an API call has been failing silently lately. It appears that the connection is timing out, but I …

  2. Geeky Goals for 2016

    Posted on in uncategorized

    The new year is finally upon us. Traditionally, I have not been one to make New Year's Resolutions. This year, I decided that rather than a list of resolutions, I would create a list of goals. These are things I would like to achieve over the next year. In other …

  3. UnicodeDecodeError: 'ascii' codec can't decode byte

    Posted on in Programming

    Although I was getting this output in relation to one of my Jinja2 templates, it really isn't a Jinja2 problem.

    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 69: ordinal not in range(128)
    

    The bit of code here should be doing nothing more than printing a float …

  4. [Python] Empty String?

    Posted on in Programming

    I've mentioned before that empty strings in Python are false. This leads to a common if not string paradigm. Unfortunately, this can be problematic. Check out this snippet:

    >>> string = ""
    >>> if not string:
    ...  print("empty")
    ... 
    empty
    

    That pretty much worked out just as we imagined. The empty string returned False and …

  5. Using Pelican's article.summary

    Posted on in Programming

    I'm using Jinja2 templates with my new Pelican-based articles. If you have Django experience, you'll feel right at home using Jinja2 templates. I decided early on that I wanted to create my own theme from scratch and keep it as basic as possible. (In fact, 'basic' is the name …

  6. Getting Started With Pelican

    Posted on in Software

    I've been using WordPress on this site since 2007. After all this time, I've decided I want to try something new. So, I've decided to go in a completely different direction and start serving static content. There are three things driving my decision to change:

    • The existing site is really …

My Bookshelf

Reading Now

Other Stuff