Created
June 7, 2021 10:54
-
-
Save thaisviana/9190c451765bf21c4c409c2afd7844ff to your computer and use it in GitHub Desktop.
matplot_pygame.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
from pygame.locals import * | |
from grafico import desenha_grafico | |
pygame.init() | |
window = pygame.display.set_mode((600, 800), DOUBLEBUF) | |
screen = pygame.display.get_surface() | |
param1, param2 = 0 , 0 | |
canvas, raw_data = desenha_grafico(param1, param2) | |
size = canvas.get_width_height() | |
surf = pygame.image.fromstring(raw_data, size, "RGB") | |
screen.blit(surf, (0,0)) | |
pygame.display.flip() | |
crashed = False | |
while not crashed: | |
for event in pygame.event.get(): | |
if event.type == pygame.QUIT: | |
crashed = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment