Pages

sâmbătă, 1 iunie 2019

PyGame : Testing example of pygame module.

The Pygame python module is a good way to start programming games.
This python module comes with examples, see the official webpage.
These should help get you started with Pygame.
The source code for these examples is in the public domain.
Today I will show you how to find and run an example from this python module.
Let's start with these commands:
C:\Python373>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD6
4)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame.examples.aliens
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
>>> pygame.examples.aliens.__file__
'C:\\Python373\\lib\\site-packages\\pygame\\examples\\aliens.py'
>>> pygame.examples.aliens.main()
The result of running the aliens game.