Programming on the Raspberry Pi – Program in python

How to create a window in Python 2.7:

  1. Open Python 2.7 (Idle) from the programming menu and type in the following:

import pygame

pygame.init()

screen = pygame.display.set_mode([640, 480])

pygame.display.set_caption(“Hello Python World!”)

NOTE: You can change the title to whatever you want the window to be called.

Save and press F5 on the keyboard.

Our Window:

hellopythonworld!

Enjoy!

Epic Chas Gamer 🙂

 

PS: SMASH THAT LIKE BUTTON!

PS: for a full screen windows then do the line pygame.display.set_mode([640, 480], a comma and then enter, then pygame.FULLSCREEN).