-2

I am learning to program in python and thought it would be fun to try to start a little bit with pygame. But for some reason when I run the code it always comes up errors, even when I copy the code letter by letter. I have tried to import pygame in the IDLE (or what it's called) and it succeded so I think pygame is properly installed. Can anyone help me to fix this problem or should I just get another computer?

By the way, sorry if I spelled anything wrong, ain't a native english speaker... :D

The-IT
  • 660
  • 8
  • 19
  • Where's your code? What are your errors? – André Dion Aug 08 '13 at 16:57
  • I picked one at random and tried to run it, this what showed up: Traceback (most recent call last): File "C:\Användare\Admin\Mina dokument\PyGame\game.py", line 8, in screen=pygame.display.set_mode((width, height)) error: No available video device – Johan Lundgren Aug 08 '13 at 17:58
  • Defiantly do not start learning python with pygame, especially if you have no programing experience. Start with basic scripts and then get really good before you consider pygame. You need to master your basics first. Otherwise, it's always a good idea to google search your errors. http://stackoverflow.com/questions/15933493/pygame-error-no-available-video-device – The-IT Aug 09 '13 at 03:27

1 Answers1

1

You have to include pygame.init() in your code before you do anything with video.

Hope that fixes the problem. I wouldn't learn Python by starting with pygame. Try watching Bucky's tutorials at TheNewBoston on Python. They will teach you about basic python syntax.

Although he does a pretty good job at teaching the Python basics, I advice you to look through the python documentation and read about useful modules, features, etc.

When you feel ready to do graphics, check his tutorials on game development (pygame).

After that, just make something.

alexpinho98
  • 909
  • 8
  • 14