Re: UTF-8 Encoding Error

2016-12-24 Thread Grady Martin

On 2016年12月22日 22時38分, subhabangal...@gmail.com wrote:

I am getting the error:
UnicodeDecodeError: 'utf8' codec can't decode byte 0x96 in position 15: invalid 
start byte


The following is a reflex of mine, whenever I encounter Python 2 Unicode errors:

import sys
reload(sys)
sys.setdefaultencoding('utf8')

A relevant Stack Exchange thread awaits you here:

http://stackoverflow.com/a/21190382/2230956
--
https://mail.python.org/mailman/listinfo/python-list


Re: for / while else doesn't make sense

2016-06-09 Thread Grady Martin

On 2016年05月19日 11時02分, Ian Kelly wrote:

"else" makes sense from a certain point of view, but I think that
logic may not be communicated well. At the start of each loop
iteration, the loop construct makes a test for whether the loop should
continue or not. If that test ever fails (i.e. if the condition of the
while loop is false), the else block is executed instead.


Thank you for the concise explanation.  (I enjoy new tools.)

As alluded to elsewhere, this distinction makes sense when loop breaking is 
involved.
--
https://mail.python.org/mailman/listinfo/python-list