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).

 

 

Advertisements

About Epic Chas Gamer

I am a computer programmer who can create a mobile app for your website. I am also a Raspberry Pi expert and modern gamer, with Minecraft as my favourite. I develop ECG SeaSurf, a web browser only just released, crafting the future. The project is available for Windows and a BETA Linux version at coolchasgamer.wordpress.com/ecg-seasurf-unstable. I will also be voicing Shield Evil in "ECG Sir Wolf's Castle", as well as Chas and a few others. UPDATED ON 12th February 2017, at 14:46
This entry was posted in How to use a Raspberry Pi and tagged , , . Bookmark the permalink.

Go on, you know you want to! Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s