Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Code, "Video System not Initialized"
Just started to get into programming with pygame. Unfortunately, I am constantly getting the following error:

[b]"C:\Programming\pygame.template.py", line 29, in <module>
for event in pygame.event.get():
pygame.error: video system not initialized

Here is my code:

# a skeleton for new pygame projects
import pygame
import random

width = 360
height = 480
FPS = 30

#define colors
white = (255, 255, 255)
black = (0, 0, 0)
red =(255, 0 ,0)
green = (0, 255, 0)
blue = (0, 0, 255)

#initialize pygame and create window
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("My Game")
clock = pygame.time.Clock()

# Game Loop
running= True
while running:
# keep loop running at the right speed
# Process input (events)
for event in pygame.event.get():
# check for closing window
if event.type == "pygame.QUIT":
running = False

# Update

# Draw / render
#after drawing flip everything


I appreciate you guys/girls help to the fullest! Heart
Please put your code in Python code tags and full error traceback message in error tags. You can find help here.
Try to put
if pygame.mixer.get_busy() != None:
for event in pygame.event.get():
Put the whole for loop in the if get_busy() block. I had the same error but for my MP3 player just yesterday and that fixed it. It can't get the event as it appears to not be initialized.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Playing video read in as binary without writing to disk ashtona 0 133 Apr-19-2018, 07:58 PM
Last Post: ashtona

Forum Jump:

Users browsing this thread: 1 Guest(s)