Artificial Intelligence, Data Science, Machine Learning, Reinforcement Learning, Programming.
env.step(action) # take a step in the environment image = env.render(mode='rgb_array') # render the environment to the screen #convert image to pygame surface object image = Image.fromarray(image,'RGB') mode,size,data = image.mode,image.size,image.tobytes() image = pygame.image.fromstring(data,