Wednesday 15 October 2014

Let's plays with Python & Pygame


Assalamualaikum, this week En Azrul had teach about Python. I was very excited to learn more about Python.I try run Python by study on internet, website and you tube. This is one of tutorial that I get from my lesson. You can also try it. Let's look my tutorial.

Step 1: Download Python 



                                                 My laptop use python 2.7.3. 

Step 2 : Download Pygame

Download Pygame at this website http://www.pygame.org/news.html and on the left of this page click download. Before you download make sure you not using python latest version because before this my laptop use Python 34 and Pygame does not work.So, i'm using Python27.


My laptop use Pygame-1.9.1.win32-py2.7.msi 


Step 3: Save the Pygame file at local DiskC/Python27/include



To make sure that you Pygame is successfully download, you can test by give a command import pygame it will display >>> , if not successful it will say  no module name pygame.

This picture is show Pygame is successful download

Step 4: Download any picture or take any picture and save in one file save at you desktop


I save the pictures in file name myfile.The first picture i'm save as background and second is as image.

Step 5: Open the Python Shell 

After open the shell, click File and click New Window.  You can see a blank page, then you enter a command.

Step 6: Click Run button and save this command at myfile with the picture together.



Step 7: Click Run button again and click Run Module



Done!



Yeahh..the Pygame is work..the picture is display.


You can try it now.Lets learn more about Python :)

                                                                       



3 comments: