I'm a beginner.
I tried to play pygame, but it didn't work, so I tried visual studio,
invalid sync (<unknown>, line 25)
appears.
"""justwindow.py"""
import sys
import pygame
from pygame.locals import QUIT
pygame.init()
SURFACE = pygame.display.set_mode((400, 300))
pygame.display.set_caption("Just Window")
def main():
"""main routine"""
while True:
SURFACE.fill((255, 255, 255))
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
pygame,display.update()
if__name__=='__main__':
main()
This is the source code Why is that?
python
In if_name__
, place a blank between if
and _name__
.
© 2025 OneMinuteCode. All rights reserved.