BrickPi Candy Sorter

Sort your Halloween candy with Google Cloud Vision and Raspberry Pi.

7. List your Gold (or Trash)

Opening up the Python program:


sudo nano

On lines 30 and 31 display two lists: one of good candy (“good_candy”) and one of bad candy going to our little brother Steve (“bad_candy”).


good_candy = ['Mars','Milky Way','Bounty']


bad_candy = ['Juicy Fruit','Doublemint', 'Snickers']

Add all the candy names you like. Note that the code will default to “bad” so if it’s not on the list, it’s not going into the good pile! In my example, I am not really interested in gum, and I hate Snickers. On the other hand, I love Bounty, Mars, and Miky Way, which are all in the Good Candy pile!