Hi cannot get images to load any help would be gratefully recieved...

import pygame
import sys
from pygame.locals import *


sys.path.append ("C:\\Python26\Bits\player.png")
###Will not Load saved image
#triedC:\Python26\Bits\player.png
# and tried C:\Python26\Bits
#confusing or what!!!

#Whole program not here



# set up the window
WINDOWWIDTH = 400
WINDOWHEIGHT = 400
windowSurface = pygame.display.set_mode((WINDOWWIDTH, WINDOWHEIGHT), 0, 32)
pygame.display.set_caption('Sprites and Sound')

player = pygame.Rect(300, 100, 40, 40)
playerImage = pygame.image.load('player.png')
playerStretchedImage = pygame.transform.scale(playerImage, (40, 40))

windowSurface.blit(playerStretchedImage, player)

pygame.display.update()


while True:
   # check for the QUIT event
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()

pygame.image.load('player.png')

Give the fullpath to the image file ok ?

pygame.image.load('fullimagepath')

Then forget about the sys.path.append() stuff.

image is not a module.
;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.