all_blocks = [[] for i in range(int(max_x / s))] for i in range(max_x): for j in range(max_y): block = Block(green, s, s) block.rect.x = i block.rect.y = j j += s all_blocks[count].append(block) i += s count += 1 if count >= max_x / s: count = 0
all_blocks = [[] for i in range(int(max_x / s))] for i in range(max_x): for j in range(max_y): block = Block(green, s, s) block.rect.x = i block.rect.y = j j += s all_blocks[count].append(block) i += s count += 1 if count >= max_x / s: count = 0
ArtyomZaitsevРасходуете слишком много памяти?
pygame.error: Out of memory
>>> import sys >>> lst = [i for i in range(10000000)] >>> sys.getsizeof(lst) 81528056 >>>
all_blocks = [[] for i in range(int(max_x/s))] for i in range(int(max_x/s)): for j in range(int(max_y/s)): block = Block(green, s, s) block.rect.x = i * s block.rect.y = j * s j += 1 all_blocks[i].append(block) i += 1