本文整理汇总了Python中Matrix.Matrix.concatenate方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.concatenate方法的具体用法?Python Matrix.concatenate怎么用?Python Matrix.concatenate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix.Matrix
的用法示例。
在下文中一共展示了Matrix.concatenate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_padding
# 需要导入模块: from Matrix import Matrix [as 别名]
# 或者: from Matrix.Matrix import concatenate [as 别名]
def add_padding(self, padding, matrix):
#validate inputs
if (not type(padding) is int or padding <= 0 or not type(matrix) is Matrix):
raise LedError("Invalid inputs. Padding must be a positive, non-zero integer")
output = Matrix(matrix.m, padding)
output = output.concatenate(matrix)
output = output.concatenate(matrix.m, padding)
return output
示例2: compute_led_screen
# 需要导入模块: from Matrix import Matrix [as 别名]
# 或者: from Matrix.Matrix import concatenate [as 别名]
def compute_led_screen (text, padding):
#validate inputs
if (not type(text) is str or not type(padding) is int or padding <= 0):
raise LedError("Only message strings are supported and padding must be a positive, non-zero integer")
#pad pixels left
output = Matrix(self.board_height, padding)
for char in text:
addition = self.char_map[char]
output = output.concatenate(addition)
#pad pixels right
output = output.concatenate(Matrix(self.board_height, padding))
return output
示例3: convert_message_led
# 需要导入模块: from Matrix import Matrix [as 别名]
# 或者: from Matrix.Matrix import concatenate [as 别名]
def convert_message_led(self):
checker = False
output = Matrix(1,1)
for char in self.message:
temp = self.char_map[char]
if (temp):
if (checker):
output = output.concatenate(temp)
else:
output.copy(temp)
checker = True
return output