[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Help with pygame



There's no way that code matches that error... the code tries to load
"car.jpeg", and the error is from a line that tried to load
"images.BMP".

So what's the actual name of the image? If you're not sure, what do
you get when you type "ls" from a command prompt in the same directory
as the python script? Or maybe you can attach the image to your reply
for others to try your code with?

My guess at the problem is you have not tried the actual filename yet.
You need to load the image file by it's actual filename, spelled
exactly correctly. And since you are having the error on a mac, it
must also have the current capitalization.

On Fri, Dec 9, 2011 at 6:26 PM, Zack Baker <zbaker1398@xxxxxxxxx> wrote:
> Hi, i wrote this code
> CODE: SELECT ALLimport pygame
> car=pygame.image.load('car.jpeg') #i have tried car.png car.bmp and so on
> screen.blit(car, (50, 100))
> pygame.display.flip()
>
>
> but i get this error
> CODE: SELECT ALLTraceback (most recent call last):
>   File "/Users/zackbaker/Desktop/Cartest.py", line 2, in <module>
>     car=pygame.image.load('images.BMP')
> error: File is not a Windows BMP file
>>>>
>
>
> HUh?? I tried BMP and bmp as extensions but i keep getting this error. Any
> help would be greatly appreciated. Thanks
> Btw I'm running Mac osx lion
>
> -Zack
>