import pygame pygame.init() font = pygame.font.Font(None, 30) def debug(info, y = 10, x = 10 ): display_surf = pygame.display.get_surface() #create some text debug_surf = font.render(str(info), True, 'light green') #create a rect with a pos debug_rect = debug_surf.get_rect(topleft = (x,y)) pygame.draw.rect(display_surf, 'Black', debug_rect) #blit all of that display_surf.blit(debug_surf, debug_rect)