All pastes #339237 Raw Edit

Mine

public text v1 · immutable
·published 2007-02-03 23:13 UTC
rendered paste body
#imports our needed modules
import pygame, sys, os
from pygame.locals import *

#initializes the display
pygame.init()

#makes the window
window = pygame.display.set_mode ((800, 600))
#changes what the title bar  says
pygame.display.set_caption('My picture in a windows')
#creates a suface
screen = pygame.display.get_surface()

#store the picture we want to display into a variable
picture = os.path.join ("picture.gif")

#loads the picture into a variable for display on the surface
picture_surface = pygame.image.load (picture)

#draws the surface and everything on it and then flips to next frame
screen.blit(picture_surface, (0,0))
pygame.display.flip()

#wathces for an "exit" event so you can close the application
def input(events):
	for event in events:
		if event.type == QUIT:
			sys.exit(0)
		else:
			print event

#the main loop, here it is just watching for inputs
while True:
	input(pygame.event.get())






#####################################################################
# The error i receive
#
#Traceback (most recent call last):
#  File "/home/surgy/pygame learning scripts/script1.py", line 20, in ?
#    picture_surface = pygame.image.load (picture)
#pygame.error: Couldn't open picture.gif
#
#
#
#
#