Skip to main content

Posts

Featured

Hi friends, we are going to load an image in python 3.3 with pygame. here are python code for loading image. first we have to call pygame moudle. If you want to call an existing python file then you have to use 'import' keyword. We are using 'from' keyword and using '*' because we want import all locals from pygame. # importing moudle import pygame, sys from pygame.locals import * Python give commenting privilige. you can make comment using '#'. comments ignored by python interpreter. Pygame.init() function is importent for running pygame successfully in your machine so it must be call before any other code. # Pygame library  initialization pygame.init() Now we will create window with 800 pixel width and 600 pixel height. we will create a screen variable for holding display related data. the line [pygame.display.set_mode([width, height]) will create your display window. # Create an 800x600 sized screen screen = pygame.displa

Latest Posts

How to write a do while loop which ask user to try again if answer is incorrect?