Skip to content

Instantly share code, notes, and snippets.

@riverfor
Created July 24, 2017 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riverfor/dae8b85b8a657d93c5086ea207c80eb3 to your computer and use it in GitHub Desktop.
Save riverfor/dae8b85b8a657d93c5086ea207c80eb3 to your computer and use it in GitHub Desktop.
easter-egg.py for qpython ios
# -*- coding: utf-8 -*-
# Author: Rriver
# Can you send the easter egg's result to us ? : )
import urllib,re,random
qw = 'http://www.qpython.org/'
html = urllib.urlopen(qw).read()
reg = r'src="(.*?\.jpg)'
imgre = re.compile(reg)
imglist = re.findall(imgre,html)
pics = []
for imgurl in imglist:
pics.append("%s%s" % (qw,imgurl))
print '<img src="%s" />' % random.choice(pics)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment