Quantcast
Channel: Programmers Heaven Forums RSS Feed
Viewing all articles
Browse latest Browse all 2703

Python Run error

$
0
0
Hello I am new here and I just started working in python a month ago. I am working on a simple program to get a little red ball to follow my mouse around. I can find the error and I don't know what the error message it gives me means. Here is the code:
bif="pygame.jpg"
mif="ball.png"

import pygame ,sys
from pygame.locals import *
pygame.init()
screen=pygame.display.set_mode((640,360),0,32)

background=pygame.image.load(pygame).convert()
mouse_c=pygame.image.load(ball).convert_alpha()

while True:
	for event in pygame.event.get():
		if event.type == QUIT:
			pygame.quit()
			sys.exit()
	screen.blit(background, (0.0))
	
	x,y = pygame.mouse.get_pos()
	x -= mouse_c.get_width()/2
	y -= mouse_c.get_height()/2
	
	screen.blit(mouse_c,(x,y))
	
	pygame.display.update()

And here is the error I get
Traceback (most recent call last):
  File "C:\Users\AwesomePilot\Documents\Programming\Pytho
n\Pygame1\gameSRC.py", line 9, in <module>
    background=pygame.image.load(pygame).convert()
error: Can't seek in this data source


If I hit run it acts like its gonna run for a second, then it freezes as a black window and the it doesn't respond. Please help Thank You :)

Viewing all articles
Browse latest Browse all 2703

Trending Articles