from __future__ import print_function
import io
import string
import random

from boggle.boggle import list_words


def main():
    with io.open("/usr/share/dict/words", encoding='latin-1') as word_file:
        english_words = set(word.strip() for word in word_file)

    available_tiles = [letter for letter in string.ascii_uppercase]
    available_tiles.remove('Q')
    available_tiles.append('Qu')

    # A boggle board is an n * n square. Set n:
    size = 15

    board = []
    for row in range(size):
        board.append([random.choice(available_tiles) for i in xrange(size)])

    found_words = list_words(
        word_list=english_words,
        board=board,
    )

    print(len(found_words))

main()

@@ -460,9 +460,9 @@
  = 1
-5
+0
 %0A%0A  
@@ -568,9 +568,8 @@
  in 
-x
 rang

Use range instead of xrange as it is also available in python 3