I am trying to blit multiple images of a moving car, using a for loop over the filenames of the images. However, it would just draw the screen but not actually show/blit the images. I am using python3.6 .
Here is my code.
import pandas as pd
import pygame
# BLACK = ( 0, 0, 0)
# WHITE = (255, 255, 255)
# BLUE = ( 0, 0, 255)
# GREEN = ( 0, 255, 0)
# RED = (255, 0, 0)
df = pd.read_csv('./result.csv')
preds = df['Predicted Angles']
true = df['Actual Angles']
filenames = df['File']
pygame.init()
size = (640, 320)
pygame.display.set_caption("Data viewer")
screen = pygame.display.set_mode(size, pygame.DOUBLEBUF)
myfont = pygame.font.SysFont("monospace", 15)
for i in range(len(list(filenames))):
img = pygame.image.load(filenames.iloc[i])
screen.blit(img, (0, 0))
pygame.display.flip()