Unofficial Raspberry Pi Clock Application

Hi guys. Today I have been experimenting with Python and Pygame. I managed to make a clock application for the Raspberry Pi.

Here is the code:

import pygame, sys, time


screen = pygame.display.set_mode((1184, 624),
pygame.display.set_caption(“Raspberry Pi Clock”)

clockFont = pygame.font.Font(None, 72)
clock = pygame.time.Clock()


WHITE = (255, 255, 255)
RED = (255, 0, 0)

logo = pygame.image.load(“/usr/share/raspberrypi-artwork/launch.png”)
piclock = pygame.image.load(“raspitimebackground.png”)

screen.blit(piclock, (0, 0))


screen.blit(logo, (0, 0))

theFont = pygame.font.Font(None, 32)
theSurf = theFont.render(“Raspberry Pi”, True, WHITE)
theRect = theSurf.get_rect()
theRect.midtop = (115, 5)
screen.blit(theSurf, theRect)

loadFont = pygame.font.Font(None, 32)
loadSurf = theFont.render(“Press Enter to load the desktop”, True, WHITE)
loadRect = theSurf.get_rect()
loadRect.midtop = (500, 300)
screen.blit(loadSurf, loadRect)
while True:
clockTime = time.strftime(“%H:%M:%S”, time.localtime())
clockText = clockFont.render(str(clockTime), True, WHITE, RED)
screen.blit(clockText, (1000, 550))
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:

The following image is required for this project file


If for some reason you ever need this image, feel free to use it. Learn more.

In the future, I will make a blog post about auto starting apps on the Pi.


Epic Chas Gamer 😀



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 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, Project Files, Python, Raspberry Pi, Raspberry Pi 3 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: Logo

You are commenting using your 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