def createKeyboard(self, strKeys): keyboard = [] for row in strKeys: newRow = map(KeyboardButton, row) keyboard.append(newRow) return keyboard