UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0x80 in position 3131: invalid start byte

It doesn’t help that you have sys.setdefaultencoding(‘utf-8′), which is confusing things further – It’s a nasty hack and you need to remove it from your code. See https://stackoverflow.com/a/34378962/1554386 for more information The error is happening because line is a string and you’re calling encode(). encode() only makes sense if the string is a Unicode, so Python tries to convert it Unicode first using … Read more

Strange symbol shows up on website (L SEP)?

That character is U+2028 or HTML entity code 
 which is a kind of newline character. It’s not actually supposed to be displayed. I’m guessing that either your server side scripts failed to translate it into a new line or you are using a font that displays it. But, since we know the HTML and UNICODE vales for the … Read more

Detect whether a Python string is a number or a letter

Check if string is nonnegative digit (integer) and alphabet You may use str.isdigit() and str.isalpha() to check whether a given string is a nonnegative integer (0 or greater) and alphabetical character, respectively. Sample Results: Check for strings as positive/negative – integer/float str.isdigit() returns False if the string is a negative number or a float number. For example: If you want to also check for the negative integers and float, then you may … Read more