인프런 커뮤니티 질문&답변
import pygame 실행이 안 돼요
작성
·
2.6K
답변 1
0
import pygame만 하면 아무것도 안 뜨는게 맞습니다.
pip install game이 아니라 pip install pygame 아닌가요
import pygame
pygame.init()
screen = pygame.display.set_mode((600, 400))
pygame.display.set_caption("Test Project")
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill((0, 0, 0))
screen.blit(pygame.font.Font(None, 30).render("Test", True, (255, 255, 255)), (100, 200))
pygame.display.update()
이 코드를 실행하고 흰색 Test 글자와 검은 배경이 뜨면 됩니다.

이렇게 뜨면 됩니다






