Awasu » How do I get my code to *?@#’ing work?!?!
Thursday 13th July 2017 7:47 PM [Tutorial]

An Awasu user recently asked for some help in getting their Python code to work with Awasu, and while the problem turned out to be related to text encoding (which is not, strictly speaking, anything to do with Awasu), since this is such a common issue, I thought I'd write up some notes on how all it works.

The canonical introductory article on the subject is, of course, Joel Spolsky's The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)", but these notes will be a more practical guide, along the lines of "How do I get my code to *?@#'ing work?!?!"[1]Now, there's a meme for you 🙂 .

Note that while this tutorial has separate sections on Python 2 and Python 3, even if you're only using one version of Python, you should read both sections if you want to really understand how things work.

This stuff is tricky to get your head around at first, but once you figure it out, it's actually not too bad. The problem is that even when you've got your code right, you start receiving content from elsewhere that is wrong, which breaks your code, so you change it to handle that content, but then your code breaks when you receive content from somewhere else that is doing things correctly[2]Or also doing things incorrectly, but in a different way :wall: , and you get stuck in a cycle where your code never works properly :wall: Hopefully, these notes will help you know when your code is right, and you can stick to your guns and start yelling at the other guy to fix their code... 🙂

   [ + ]

1. Now, there's a meme for you 🙂
2. Or also doing things incorrectly, but in a different way :wall:

2 Responses to this post

Thanks for creating this, especially with the Python examples; this will help me also even though all my feeds are plain-old, boring English.

No worries.

>>> this will help me also even though all my feeds are plain-old, boring English.

You'd be surprised. All it takes is one person to start moaning about how something is passé or include a 😹, and your plugins will all break 😥

And if you want to see something scary, I noticed this while writing this comment (open this page in Firefox and hover your mouse over the link :bigshock: ).

Have your say