📅  最后修改于: 2022-03-11 14:45:31.683000             🧑  作者: Mango
with open('file') as f:
w, h = [int(x) for x in next(f).split()] # read first line
array = []
for line in f: # read rest of lines
array.append([int(x) for x in line.split()])