From 7f497f2b61103c564554d480ec03e7aeeced45b8 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 10 May 2015 13:10:39 +0100 Subject: [PATCH] Added file for random fun bits of code --- eggs.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 eggs.py diff --git a/eggs.py b/eggs.py new file mode 100644 index 0000000..68b3bf9 --- /dev/null +++ b/eggs.py @@ -0,0 +1,13 @@ +import pygame, logging, urllib.request, io +from time import sleep + +def r9k(window): + logging.warn("Look, you found a pepe!") + raw_image = urllib.request.urlopen("https://38.media.tumblr.com/avatar_2cd47bc1ad07_128.png").read() + image_file = io.BytesIO(raw_image) + image = pygame.transform.scale(pygame.image.load(image_file), window.get_size()) + window.blit(image, (0,0)) + font = pygame.font.SysFont(None, 30, bold=False) + window.blit(font.render("A rare pepe has been found. Alert R9k", True, (0,0,0)), (window.get_width()/2-150, window.get_height()/2)) + pygame.display.update() + sleep(5) \ No newline at end of file