def word_bank(self): outStr = '' temp_list = duplicate(self.current_word_list) random.shuffle(temp_list) # randomize word list for word in temp_list: outStr += '%s\n' % word.word return outStr
def print_word_bank(self): print('== Word Bank ==') temp_list = duplicate(self.current_word_list) random.shuffle(temp_list) # randomize word list for w in temp_list: print(w.original.strip()) print
def word_bank(self): out_str = '' temp_list = duplicate(self.current_word_list) random.shuffle(temp_list) # randomize word list for word in temp_list: out_str += '%s\n' % word.word return out_str
def word_bank(self): outStr = '' temp_list = duplicate(self.current_word_list) random.shuffle(temp_list) # randomize word list for word in temp_list: outStr += '%s\n<br/>' %(word.word) return outStr.encode('utf-8')
def append( collection, toAppend ): from copy import copy as duplicate """ Appends the second argument to a copy of the first and returns the appended list. This uses a shallow copy operation. """ copy = duplicate( collection ) copy.append( toAppend ) return copy
def get_shuffled_word_list(self): """Returns a string of (shuffled) words (solutions)""" outStr = '' tmplist = copy.duplicate(self.crossword.placed_words) random.shuffle(tmplist) # randomize word list for word in tmplist: outStr += '%s\n' % word.word return outStr
def append(collection, toAppend): from copy import copy as duplicate """ Appends the second argument to a copy of the first and returns the appended list. This uses a shallow copy operation. """ copy = duplicate(collection) copy.append(toAppend) return copy
def word_bank(self): outStr = '' temp_list = duplicate(self.current_word_list) random.shuffle(temp_list) # randomize word list for word in temp_list: outStr += '%s\n' % word.word fo = open("foo.txt", "a") fo.write(outStr) # Close opend file fo.close() return outStr